#include <bits/stdc++.h>
using namespace std;
void solve(int n) {
  int cnt = 0;
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      if (n - i - j >= 0) {
        if (n - i - j <= 1000) {
          cnt += n - i - j + 1;
        } else if (n - i - j <= 2000) {
          cnt += n - i - j - 1000 + 1;
        }
      }
    }
  }
  cout << cnt << endl;
}
int main() {
  int n;
  while (cin >> n) {
    solve(n);
  }
}
