#include <bits/stdc++.h>
using namespace std;
int halfComb[2001];
void init() {
  for (int i = 0; i < 1001; i++)
    for (int j = 0; j < 1001; j++) halfComb[i + j]++;
}
int main() {
  long long int cnt;
  int n, mx;
  init();
  while (cin >> n) {
    cnt = 0;
    mx = (n < 2000 ? n : 2000);
    for (int i = 0; i <= mx; i++) {
      if (0 <= n && n <= 2000) cnt += halfComb[i] * halfComb[n - i];
    }
    cout << cnt << endl;
  }
  return 0;
}
