#include <bits/stdc++.h>
using namespace std;
long long int c[1000][1000], n, ans;
int main() {
  cin >> n;
  for (int i = 5; i <= 7; i++) {
    for (int j = 0; j <= 777; j++) {
      for (int k = 0; k <= 777; k++) {
        c[j][k] = 0;
      }
    }
    for (int j = 0; j <= i; j++) {
      c[0][j] = 1;
    }
    for (int k = 1; k <= n - i; k++) {
      c[k][0] = 1;
    }
    for (int k = 1; k <= n - i; k++) {
      for (int j = 1; j <= i; j++) {
        c[k][j] = c[k - 1][j] + c[k][j - 1];
      }
    }
    ans += c[n - i][i];
  }
  cout << ans << endl;
}
