import java.util.Scanner; import java.math.BigInteger; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(),k = scan.nextInt(); BigInteger[] dp = new BigInteger[n+1]; dp[0] = new BigInteger("1"); for(int i = 1; i <= n; i++){ for(int j = 1; j <= k; j++){ int pos = i - j; if(pos < 0) continue; if(dp[i] == null) dp[i] = new BigInteger("0"); dp[i] = dp[i].add(dp[pos]); } } System.out.println(dp[n].toString()); } }