#include <bits/stdc++.h>
using namespace std;
const int N = 777 + 10;
int n;
long long ans, dp[N][N];
void comb() {
  dp[0][0] = 1;
  for (int i = 1; i < N; i++) {
    for (int j = 0; j < 8; j++) {
      if (j == 0 || j == i) dp[i][j] = 1;
      dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];
    }
  }
  return;
}
int main() {
  comb();
  cin >> n;
  for (int i = 5; i < 8; i++) ans += dp[n][i];
  cout << ans << endl;
  return 0;
}
