#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  while (cin >> n) {
    long long ans = 0;
    for (long long a = 0; a <= n; ++a) {
      for (long long b = 0; a + b <= n; ++b) {
        ans += min(1000LL, n - a - b) - max(0LL, n - 1000LL - a - b) + 1LL;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
