#include <bits/stdc++.h>
using namespace std;
long long comb[780][8];
void NenK() {
  for (int i = 0; i < 8; i++) comb[i][i] = 1;
  for (int i = 0; i < 780; i++) comb[i][0] = 1;
  for (int i = 1; i < 780; i++)
    for (int j = 1; j < 8; j++)
      comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
}
long long n;
int main() {
  NenK();
  cin >> n;
  cout << comb[n][5] + comb[n][6] + comb[n][7];
}
