#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
typedef pair<int,int> P;
#define INF 1e9
#define rep(i,N) for(int i=0;i<N;i++)

int main(){
    int l,k;
    cin>>l>>k;
    ll dp[l+1][2];
    int cnt = 0;
    memset(dp,0,sizeof(dp));
    dp[0][0] = 1;
    rep(i,l+1){
        rep(j,2){
            if(i>=1){
                dp[i][j] += dp[i-1][j^1];
            }
            if(j%2==1 && i>=k)dp[i][j] += dp[i-k][j^1];
        }
    }
    ll ans = 0;
    rep(i,l+1){
        //cout<<"i:"<<i<<" dp:"<<dp[i][1]<<endl;
        ans += dp[i][1];
    }
    cout<<ans<<endl;
}
