import sys

def apple_method(m,n):
if m == 0 or n ==1:
return 1
if n > m:
return apple_method(m,m)
else:
return apple_method(m, n-1) + apple_method(m-n, n)

if name == 'main':
while True:
m = sys.stdin.readline().strip()
if m == '':
break
n = sys.stdin.readline().strip()
m = int(m)
n = int(n)
result = apple_method(m, n)
print(result)