#include <bits/stdc++.h>
int n;
int sum[2000];
int main() {
  for (int i = 0; i <= 1000; ++i)
    for (int j = 0; j <= 1000; ++j) ++sum[i + j];
  while (std::cin >> n) {
    int ans = 0;
    for (int a = 0; a <= n; ++a) ans += sum[a] * sum[n - a];
    std::cout << ans << std::endl;
  }
  return 0;
}
