#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
LL arr[105];
LL cal(LL n, LL k){
	if (k == 1) { arr[1] = n; return n; }
	arr[k] = (n - k + 1)*arr[k - 1] / k;
	return arr[k];
}
int main()
{
	LL l, k;
	scanf("%lld%lld", &l, &k);
	LL h, h_temp, ans = 0;
	if (l & 1) h = l;
	else h = l - 1;//h表示块高为1时的总高度

	while(h > 0){
		h_temp = h;
		ans++;
		LL n = (h + 1) / 2;//n表示黑块的个数
		while (h_temp + k - 1 <= l&&n > 0){
			h_temp += k - 1;
			--n;
			ans += cal((h + 1) / 2, (h + 1) / 2 - n);
		}
		h -= 2;
	}
	printf("%lld\n", ans);

	return 0;
}

