#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>

using namespace std;

using lint = long long;
using ldouble = long double;

int main() {
    int L, K;
    cin >> L >> K;
    vector<vector<lint>> dp(2, vector<lint>(L + 1, 0));
    // 0なら直前は白
    dp[0][0] = 1;

    for (int l = 0; l < L; ++l) {
        dp[0][l + 1] += dp[1][l];
        dp[1][l + 1] += dp[0][l];
        if (l + K <= L) dp[1][l + K] += dp[0][l];
    }

    cout << accumulate(dp[1].begin() + 1, dp[1].end(), 0LL) << endl;
    return 0;
}

