#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int main() {
  vector<int> sum;
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      sum.push_back(i + j);
    }
  }
  sort(sum.begin(), sum.end());
  int n;
  while (scanf("%d", &n) != EOF) {
    int ans = 0;
    for (int i = 0; i < sum.size(); i++) {
      int a = n - sum[i];
      if (a < 0) break;
      ans += upper_bound(sum.begin(), sum.end(), a) -
             lower_bound(sum.begin(), sum.end(), a);
    }
    cout << ans << endl;
  }
  return 0;
}
