#include <bits/stdc++.h>
using namespace std;
long long n, m, t, tot;
long long combi(long long k, long long r) {
  if (k < r) {
    return 0;
  }
  long long cur = 1;
  for (long long i = 0; i < min(r, k - r); i++) {
    cur = cur * (k - i);
    cur = cur / (i + 1);
  }
  return cur;
}
int main() {
  cin >> n;
  cout << combi(n, 5) + combi(n, 6) + combi(n, 7) << endl;
}
