#include <bits/stdc++.h>
using namespace std;
int n;
int k[4000];
int main() {
  for (int c = 0; c <= 1000; c++)
    for (int d = 0; d <= 1000; d++) k[c + d]++;
  while (cin >> n) {
    int ans = 0;
    for (int a = 0; a <= 1000; a++)
      for (int b = 0; b <= 1000; b++) {
        if (a + b > n) break;
        ans += k[n - (a + b)];
      }
    cout << ans << endl;
  }
  return 0;
}
