#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1.0);
long long int inf = 0x3f3f3f3f3f3f3f3f;
const long long int mod = 1e9 + 7;
const long long int mx = 5 * 1000000;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long double f1 = 1;
  long double f2 = 1;
  long double f3 = 1;
  long double f5 = 120, f6 = 1, f7 = 1;
  f6 = f5 * 6;
  f7 = f6 * 7;
  for (long long int i = n - 5 + 1; i <= n; i++) f1 *= i;
  for (long long int i = n - 6 + 1; i <= n; i++) f2 *= i;
  for (long long int i = n - 7 + 1; i <= n; i++) f3 *= i;
  long double ans = 0;
  ans += f1 / f5 + f2 / f6 + f3 / f7;
  cout << (long long int)ans << endl;
}
