#include <bits/stdc++.h>
void sum_of_4_int(int n, int sum, int i, int *count) {
  if (n < sum) {
    return;
  }
  if (sum + (4 - i) * 1000 < n) {
    return;
  }
  if (i < 4) {
    for (int j = 0; j <= 1000; ++j) {
      sum_of_4_int(n, sum + j, i + 1, count);
    }
  } else {
    if (n == sum) {
      (*count)++;
    }
  }
}
int main() {
  int n;
  while (std::cin >> n) {
    int combination;
    sum_of_4_int(n, 0, 0, &combination);
    std::cout << combination << std::endl;
  }
  return 0;
}
