#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const int MOD = 1000000007;
const int N = 400055;
const int M = 511;
void solve() {
  long long n;
  cin >> n;
  long long a = n * (n - 1) * (n - 2) * (n - 3) * (n - 4) / 120;
  long long b = a * (n - 5) / 6;
  long long c = b * (n - 6) / 7;
  cout << a + b + c;
}
int main() {
  ios_base::sync_with_stdio(false);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
