#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

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

    vector<vector<ll>> dp(l + 1, vector<ll>(2, 0));  //0-black
    dp[0][1] = 1;
    for (int i = 0; i <= l; i++) {
        if (i + 1 <= l) {
            dp[i + 1][1] += dp[i][0];
        }
        if (i + 1 <= l) {
            dp[i + 1][0] += dp[i][1];
        }
        if (i + k <= l) {
            dp[i + k][0] += dp[i][1];
        }
    }

    ll sum = 0;
    for (int i = 1; i <= l; i++) {
        sum += dp[i][0];
    }
    cout << sum << endl;

    return 0;
}