#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    unsigned long long n, t;
    cin >> n;
    unsigned long long x = n / 1 * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 *
                           (n - 4) / 5 * (n - 5) / 6 * (n - 6) / 7;
    x = x + (n / 1 * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5 *
             (n - 5) / 6);
    x = x + (n / 1 * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5);
    cout << x;
  }
}
