#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<62;
const LL INF=1<<17;


int main(){
    LL l,k;cin >> l >> k;
    vector<LL> dp(l+1,0);
    dp[1]=1;
    if(k<=l) dp[k++]=1;
    for (int i = 1; i <= l; i++) {
        if(i+2<=l) dp[i+2]+=dp[i];
        if(i+k<=l) dp[i+k]+=dp[i];
    }
    cout << accumulate(dp.begin()+1,dp.end(),0LL) << endl;
    return 0;
}

