#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000;
long long chs[maxn][maxn], n;
long long solve(int r, int n) {
  if (r == 0 || r == n) return 1;
  if (r < 0 || r > n) return 0;
  if (chs[r][n] == -1) chs[r][n] = solve(r - 1, n - 1) + solve(r, n - 1);
  return chs[r][n];
}
int main() {
  for (int i = 0; i < maxn; i++) fill(chs[i], chs[i] + maxn, -1);
  cin >> n;
  cout << solve(5, n) + solve(6, n) + solve(7, n);
  return 0;
}
