#include <bits/stdc++.h>
int half[2001];
void makeSet() {
  memset(half, 0, sizeof(half));
  for (int i = 0; i <= 1000; ++i) {
    for (int j = 0; j <= 1000; ++j) {
      int k = i + j;
      ++half[k];
    }
  }
}
int solve(int n) {
  int num = 0;
  int max = n < 2000 ? n : 2000;
  for (int i = 0; i <= max; ++i) {
    num += half[i] * half[n - i];
  }
  return num;
}
int main() {
  makeSet();
  while (true) {
    int n;
    std::cin >> n;
    if (std::cin.eof()) break;
    std::cout << solve(n) << std::endl;
  }
  return 0;
}
