#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
typedef pair<int,int> P;

ll C[110][110];
void combi(){
	for(int n=0;n<=100;n++){
		C[n][0]=C[n][n]=1;
		for(int k=1;k<n;k++){
			C[n][k]=C[n-1][k-1]+C[n-1][k];
		}
	}
}

int main(void){
	          ll i,j;

	      	  cin.tie(0);  ios_base::sync_with_stdio(false);

	      	  ll L,K;
	      	  cin >> L >> K;

	      	  combi();
	      	  ll ans=0;
	      	  for(i=0;i<=100;i++){
	      		  for(j=0;j<=100;j++){
	      			  ll c=(K+1)*i+2*j-1;
	      			  if(c>L || c<1) continue;
	      			  ans+=C[i+j][i];
	      		  }
	      	  }

	      	  cout << ans << endl;

	          return 0;
}