#include <bits/stdc++.h>
int main() {
  int n;
  while (std::cin >> n) {
    int count = 0;
    for (int a = 0; a <= 1000; a++) {
      for (int b = 0; b <= 1000; b++) {
        for (int c = 0; c <= 1000; c++) {
          if (0 <= n - a - b - c && n - a - b - c <= 1000) count++;
        }
      }
    }
    std::cout << count << std::endl;
  }
  return 0;
}
