#include<bits/stdc++.h>
#define int long long
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int l, k, sum, dp[100];
signed main() {
	cin >> l >> k;
	dp[1] = 1; dp[k++] = 1;
	for1(i, l) {
		if (i > 2)dp[i] += dp[i - 2];
		if (i > k)dp[i] += dp[i - k];
		sum += dp[i];
	}
	cout << sum << endl;
}
