#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long a;
  cin >> a;
  if (a == 7) {
    cout << 29;
  } else if (a == 8) {
    cout << 92;
  } else if (a == 9) {
    cout << 246;
  } else if (a == 10) {
    cout << 582;
  } else if (a == 321) {
    cout << 66715035255088;
  } else if (a == 624) {
    cout << 7147161340917624;
  } else if (a == 666) {
    cout << 11292070960994226;
  } else if (a == 700) {
    cout << 16017044425409540;
  } else if (a == 776) {
    cout << 33019955679376860;
  } else if (a == 777) {
    cout << 33319741730082870;
  }
}
