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

#define int long long

int l, k;
int dp[101][2];

int dfs(int n, int t) {
  if ( n > l ) return 0;
  if ( dp[n][t] >= 0 ) return dp[n][t];

  int ret = 0; 
  if ( !t ) {
    ret += dfs(n+1, 1) + dfs(n+k, 1);    
  } else {
    ret = 1;    
    ret += dfs(n+1, 0);    
  }

  return dp[n][t] = ret;  
}

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  cin >> l >> k;

  fill_n(*dp, 101*2, -1);

  cout << dfs(1, 1)+dfs(k, 1) << endl;  
  
  return 0;
}

