#include <bits/stdc++.h>
using namespace std;
long long int dp[800][800];
long long int ncr(long long int n, long long int r) {
  if (n == r) return 1;
  if (r == 1) return n;
  if (dp[n][r] != -1) return dp[n][r];
  return dp[n][r] = ncr(n - 1, r) + ncr(n - 1, r - 1);
}
int main() {
  long long int n, ans = 0;
  cin >> n;
  memset(dp, -1, sizeof(dp));
  for (int i = 5; i < 8; i++) ans += ncr(n, i);
  cout << ans;
  return 0;
}
