#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toStr(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX / 10;
int main() {
  int n;
  vector<int> ab, cd;
  for (int a = (0); a <= (1000); ++a) {
    for (int b = (0); b <= (1000); ++b) {
      ab.push_back(a + b);
      cd.push_back(a + b);
    }
  }
  sort((ab).begin(), (ab).end());
  while (cin >> n) {
    int ans = 0;
    for (int i = (0); i <= ((cd.size()) - 1); ++i) {
      ans += upper_bound((ab).begin(), (ab).end(), n - cd[i]) -
             lower_bound((ab).begin(), (ab).end(), n - cd[i]);
    }
    cout << ans << endl;
  }
  return 0;
}
