#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

int main(void) {
    ll l, k;
    cin >> l >> k;

    vector<vector<ll>> dp(l+1, vector<ll>(2));
    dp[0][0] = 1;
    REP(i, l+1) REP(j, 2) {
        if(j == 0) {
            if(i+1<=l) dp[i+1][1] += dp[i][0];
            if(i+k<=l) dp[i+k][1] += dp[i][0];
        } else {
            if(i+1<=l) dp[i+1][0] += dp[i][1];
        }
    }

    ll ret = 0;
    FOR(i, 1, l+1) ret += dp[i][1];
    cout << ret << endl;

    return 0;
}
