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