#include <bits/stdc++.h>
using namespace std;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int n;
int main(void) {
  long long dp[4][4001];
  for (int i = 0; i < (int)(4001); i++) dp[0][i] = 1;
  for (int i = 1; i <= 3; i++)
    for (int j = 4000; j >= 0; j--)
      for (int k = 0; k <= 1000; k++) {
        if (j - k < 0) break;
        dp[i][j] += dp[i - 1][j - k];
      }
  while (cin >> n) cout << dp[3][n] << endl;
  return 0;
}
