#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int dp[4001];
  while (true) {
    cin >> n;
    if (cin.eof()) {
      return 0;
    }
    for (int i = 0; i <= n; i++) {
      dp[i] = 1;
    }
    for (int i = 0; i < 3; i++) {
      for (int j = n; j >= 0; j--) {
        for (int k = 1; k <= 1000 && j - k >= 0; k++) {
          dp[j] += dp[j - k];
        }
      }
    }
    cout << dp[n] << endl;
  }
}
