#include <bits/stdc++.h>
using namespace std;
long int n, a, ans;
vector<long int> ss1, aa;
int main() {
  while (1) {
    cin >> n;
    ans = 0;
    ss1.clear();
    for (int i = 0; i <= 1000; i++) {
      for (int j = 0; j <= 1000; j++) {
        if (i + j <= n) ss1.push_back(i + j);
      }
    }
    sort(ss1.begin(), ss1.end());
    int cnt = ss1.size() - 1;
    for (int i = 0; i < ss1.size(); i++) {
      for (int j = 0; j < ss1.size(); j++) {
        if (ss1[i] + ss1[j] == n) ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
