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

typedef long long ll;
typedef vector<ll> vi;
typedef vector<long long> vl;
#define pb push_back
#define ff first
#define ss second
#define forn(n) for (ll i = 0; i < n; i++)
#define forc(cn, abc) ((cn).find(abc) != (cn).end())
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define poin(x) cout << fixed << setprecision(x);

int dp[35][35];
ll n, r;
ll combination(ll n, ll r)
{
    if (n == r)
        return 1;

    if (r == 1)
        return n;

    if(dp[n][r] != -1)
        return dp[n][r];

    return dp[n][r] = combination(n - 1, r) + combination(n - 1, r - 1);
}
void solve()
{
    memset(dp, -1, sizeof(dp));
    cin >> n >> r;

    ll output = combination(n, r);
    cout << output << endl;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    ll t = 1;
    while (t--)
    {
        solve();
    }

    return 0;
}
