#include <bits/stdc++.h>
using namespace std;
int data[4][4001] = {};
long long int saiki(int N, int x) {
  if (N < 0) return 0;
  if (N > x * 1000) return 0;
  if (x == 1 && N <= 1000) return 1;
  int count = 0;
  for (size_t i = 0; i <= 1000 && i <= N; i++) {
    { data[x - 1][N - i] = saiki(N - i, x - 1); }
    count += data[x - 1][N - i];
  }
  return count;
}
int main() {
  int N;
  while (cin >> N) {
    cout << saiki(N, 4) << endl;
  }
}
