#include <bits/stdc++.h>
std::map<int, int> front, back;
void makeSet() {
  for (int i = 0; i <= 1000; ++i) {
    for (int j = 0; j <= 1000; ++j) {
      int k = i + j;
      if (front.find(k) == front.end())
        front.insert(std::pair<int, int>(k, 1));
      else
        ++front[k];
      if (back.find(k) == back.end())
        back.insert(std::pair<int, int>(k, 1));
      else
        ++back[k];
    }
  }
}
int solve(int n) {
  int num = 0;
  for (std::map<int, int>::iterator i = front.begin(); i != front.end(); ++i) {
    std::map<int, int>::iterator j = back.find(n - i->first);
    if (j != back.end()) num += i->second * j->second;
  }
  return num;
}
int main() {
  makeSet();
  while (!std::cin.eof()) {
    int n;
    std::cin >> n;
    std::cout << solve(n) << std::endl;
  }
  return 0;
}
