#include <bits/stdc++.h>
using namespace std;
long long n;
long long nCr(long long x, long long y) {
  long long res = 1;
  for (int i = 1; i <= y; i++, x--) {
    res *= x, res /= i;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cout << nCr(n, 5) + nCr(n, 6) + nCr(n, 7) << endl;
  ;
  return 0;
}
