#include <cstdio>
#include <cstring>
using namespace std;

typedef long long LL;

const int maxl = 100 + 10;
LL dp[maxl][2];
LL ans = 0;

int main() {
    int l, k;
    while (~scanf("%d%d", &l, &k)) {
        memset(dp, 0, sizeof(dp));
        dp[0][0] = 1;
        for (int i = 0; i < l; i++) {
            for (int j = 0; j < 2; j++) {
                if (dp[i][j]) {
                    dp[i + 1][j ^ 1] += dp[i][j];
                    if (!j)
                        dp[i + k][j ^ 1] += dp[i][j];
                }
            }
        }

        for (int i = 0; i < l; i++)
            ans += dp[i + 1][1];
        printf("%lld\n", ans);
    }
    return 0;
}

