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