#include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
int main() {
  long long n, z, x, y;
  cin >> n;
  z = (n * (n - 1) * (n - 2) * (n - 3) * (n - 4)) / 120;
  x = (z * (n - 5)) / 6;
  y = (x * (n - 6)) / 7;
  cout << z + x + y << "\n";
  return 0;
}
