#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, K, ans = 0;
  cin >> N >> K;
  long long bus = N - K;
  for (long long y = 0; y < bus; y++) {
    long long sum = 1, sum_under = 1;
    for (long long k = 0; k < K; k++) {
      sum *= N + 1 - k;
    }
    for (long long x = K; x > 0; x--) sum_under *= K;
    ans += sum / sum_under;
    K++;
  }
  cout << ans << endl;
  return 0;
}
