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

int facctorialMethod(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
 
int main() {
  int N,K;
  cin >> N >> K;
  int sum = 0;
  for(int i = 0;i<N-K+2;i++){
    sum += facctorialMethod(N+1)/facctorialMethod(N+1-(K+i))/facctorialMethod(K+i);
  }
  cout << sum << endl;
}