#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, long long> mp;
long long c(int n, int m) {
  if (n == m || m == 0) return 1;
  long long a, b;
  if ((a = mp[{n - 1, m}]) == 0) a = mp[{n - 1, m}] = c(n - 1, m);
  if ((b = mp[{n - 1, m - 1}]) == 0) b = mp[{n - 1, m - 1}] = c(n - 1, m - 1);
  return a + b;
}
int main() {
  int n;
  cin >> n;
  cout << c(n, 5) + c(n, 6) + c(n, 7);
}
