#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll l,k;
ll ans;

ll mem[5000][5000];
ll comb(ll a,ll b){
  if(mem[a][b]) return mem[a][b];
  if(b == 0) return mem[a][b] = 1;
  if(a == b) return mem[a][b] = 1;
  return mem[a][b] = comb(a-1,b-1)+comb(a-1,b);
}

int main(){
  cin >> l >> k;
  for(ll i = 1;i+i-1 <= l;i++){
    for(ll j = 0;i+i-1+j*(k-1) <= l && j <= i;j++){
      ans += comb(i,j);
    }
  }
  cout << ans << endl;

}

