#include <bits/stdc++.h>
using namespace std;
//make_tuple emplace_back next_permutation push_back make_pair second first setprecision

#if MYDEBUG
#include "lib/cp_debug.h"
#else
#define DBG(...) ;
#endif

using LL = long long;
constexpr LL LINF=334ll<<53;
constexpr int INF=15<<26;
constexpr LL  MOD=1E9+7;

struct Problem{
    int l,k;
    vector<vector<LL>> dp;
    Problem(LL l,LL k):l(l),k(k),dp (l+1,vector<LL>(2)){};

    void solve(){
        dp[0][0]=1;
        for(int i=1; i<=l; ++i){
            dp[i][0]=dp[i-1][1];
            dp[i][1]=dp[i-1][0];
            if(i>=k)dp[i][1]+=dp[i-k][0];
        }
        LL ans =0;
        for(int i=1; i<=l; ++i){
            ans+=dp[i][1];
        }
        cout << ans <<"\n";
    }
};

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    long long l=0,k;
    cin >> l >> k;

    Problem p(l,k);
    p.solve();
    return 0;
}