#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int N = 1000005;
long long nCr(int n, int r) {
  long long factN = 1;
  r++;
  bool f[r];
  for (int i = 1; i < r; i++) {
    f[i] = 1;
  }
  for (int i = 1; i < r; i++) {
    factN *= n--;
    for (int j = 1; j < r; j++) {
      if (f[j] and factN % j == 0) {
        factN /= j;
        f[j] = 0;
      }
    }
  }
  return factN;
}
long long n, res;
void init() {
  cin >> n;
  res = nCr(n, 5) + nCr(n, 6) + nCr(n, 7);
  cout << res << endl;
}
void fread() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  init();
  return 0;
}
