#include <bits/stdc++.h>
using namespace std;
void find(int* arr, int n, int k, bool* vis, set<int>& s, int num, int idx,
          int** dp) {
  if (idx >= k) {
    if (s.find(num) == s.end()) {
      s.insert(num);
    }
  }
  if (idx == n) {
    return;
  }
  if (dp[idx][num] != 0) {
    return;
  }
  for (int i = 0; i <= n; i++) {
    if (vis[i] == false) {
      vis[i] = true;
      find(arr, n, k, vis, s, num + arr[i], idx + 1, dp);
      vis[i] = false;
    }
  }
  dp[idx][num] = 1;
  return;
}
int main() {
  int n, k;
  cin >> n >> k;
  int* arr = new int[n + 1];
  bool* vis = new bool[n + 1];
  int tsum = 0;
  for (int i = 0; i <= n; i++) {
    vis[i] = false;
    arr[i] = i + 1;
    tsum += arr[i];
  }
  int** dp = new int*[n + 3];
  for (int i = 0; i <= n + 2; i++) {
    dp[i] = new int[2 * tsum + 1];
    for (int j = 0; j <= 2 * tsum; j++) {
      dp[i][j] = 0;
    }
  }
  set<int> s;
  find(arr, n + 1, k, vis, s, 0, 0, dp);
  cout << s.size();
  return 0;
}
