#include<iostream>
#include<cstdio>
using namespace std;
#define ll long long
ll a,b,c,d,e,q[1007]={0};
int main(){
	scanf("%lld%lld",&a,&b);
	q[1]=1;
	q[b]=1;
	for (int i=1;i<=a;i++){
		q[i]=q[i]+q[i-2]+q[i-b-1];
	}
	ll ans=0;
	for (int i=1;i<=a;i++) ans+=q[i];
	printf("%lld",ans);
	return 0;
}
