#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  long long dp[5][4001];
  dp[0][0] = 1;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4001; j++) {
      if (dp[i][j]) {
        for (int k = 0; k < 1001; k++) {
          dp[i + 1][j + k] += dp[i][j];
        }
      }
    }
  }
  while (cin >> n) {
    cout << dp[4][n] << endl;
  }
}
