#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
const int MaxN = 105;
LL dp[MaxN][4];
int main(){
	int n,k;
	cin >> n >> k;
	dp[1][1] = 1; dp[k][1] = 1;
	for(int i = 1; i <= n; i++){
		dp[i][0] += dp[i-1][1];
		dp[i][1] += dp[i-1][0];
		if(i-k >= 0) dp[i][1] += dp[i-k][0];
	}
	LL ans = 0;
	for(int i = 1; i <= n; i++) ans += dp[i][1];
	cout<<ans<<endl;
	return 0;
}
