import java.util.Scanner;
//华为oj放苹果
public class layApple {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String apple = scanner.next();
String tray = scanner.next();
int findNum = findNum(Integer.parseInt(apple),Integer.parseInt(tray));
System.out.println(findNum);
}
private static int findNum(int apple, int tray) {
if (tray == 1 || apple == 0) {
return 1;
}
if (apple < tray) {
return findNum(apple, apple);
}
return findNum(apple, tray - 1) + findNum(apple - tray, tray);
}
}