#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }



int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
   
    int l, k;
    cin >> l >> k;
    
    ll dp[104][2] = {0};
    dp[1][0] = 1;
    dp[k][0] = 1;
    
    rep(i, l) rep(j, 2) {
        if (dp[i][j] == 0) continue;
        dp[i + 1][j ^ 1] += dp[i][j];
        if (j == 1) dp[i + k][j ^ 1] += dp[i][j];
    }
    
    ll ans = 0;
    rep(i, l + 1) ans += dp[i][0];
    cout << ans << endl;
}



