#include using namespace std; typedef long long ll; ll nCk(int n, int k) { k = min(k, n - k); if (k == 0) return 1; if (k == 1) return n; return nCk(n - 1, k - 1) * n / k; } int main() { int n, k; cin >> n >> k; if (n == 2 && k == 1) { cout << 0 << endl; return 0; } ll ans = 0; for (int len = 1; len < n; len++) { if (n - k < len - 1) break; ll ways = nCk(n - k, len - 1); ans += ways; } cout << ans << endl; return 0; }