#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define rep1(i,n) for(int i=1; i<n; i++)
typedef long long LL;

int main(){
    int l, k;
    cin >> l >> k;
    LL ans = 0;
    int t = k+1;
    for(int nf=0; 1+nf*2 <= l; nf++){
        int ns = (l-(1+nf*2))/t;
        rep(j, ns+1){
            LL tmp = 1;
            rep(i, min(nf, j)){
                tmp *= (nf+j-i);
                tmp /= (i+1);
            }
            ans += tmp;
        }
    }
    for(int nf=0; k+nf*2 <= l; nf++){
        int ns = (l-(k+nf*2))/t;
        rep(j, ns+1){
            LL tmp = 1;
            rep(i, min(nf, j)){
                tmp *= (nf+j-i);
                tmp /= (i+1);
            }
            ans += tmp;
        }
    }
    cout << ans << endl;
}




    


