#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = (1 << 30) - 1;
const int MAXN = 100010;
const int MAX_LOG = 18;
const int mod = 1e9 + 7;
long long n, t;
int main() {
  cin >> n;
  long long ans = n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5;
  ans +=
      n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5 * (n - 5) / 6;
  ans += n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5 * (n - 5) /
         6 * (n - 6) / 7;
  cout << ans << endl;
  return 0;
}
