#include <bits/stdc++.h>
using namespace std;

#define pb         push_back

typedef long long ll;
const ll INF = 1000000000000000000ll;
const ll MOD = 1000000007ll;
const double EPS = 1e-8;

long long dp[101][2];
// ??? 0
// ??? 1

int main(void) {
	//ios_base::sync_with_stdio(false);
	//cin.tie(0);
	
	int l, k;
	cin >> l >> k;

	dp[0][0]  = 1;
	dp[0][1]  = 0;

	ll ans = 0;
	for(int i=1; i<=l; i++){
		if(i - k >= 0){
			dp[i][0] = dp[i-1][1];
			dp[i][1] = dp[i-1][0] + dp[i-k][0];
		}else{
			dp[i][0] = dp[i-1][1];
			dp[i][1] = dp[i-1][0];
		}
		ans += dp[i][1];
		//printf("w%d: %lld\n", i, dp[i][0]);
		//printf("b%d: %lld\n", i, dp[i][1]);
	}

	cout << ans << endl;
	
	return 0;
}