#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    long long int ans = 0;
    for (int a = 0; a <= n; a++) {
      if (a > 1000) break;
      for (int b = 0; b <= n - a; b++) {
        if (b > 1000) break;
        for (int c = 0; c <= n - a - b; c++) {
          if (c > 1000) break;
          if (n - a - b - c <= 1000) ans++;
        }
      }
    }
    cout << ans << endl;
  }
}
