#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1000000009;
signed main() {
  long long n;
  while (cin >> n) {
    long long ans = 0;
    for (long long i = 0; i < (1000); i++) {
      for (long long j = 0; j < (1000); j++) {
        for (long long k = 0; k < (1000); k++) {
          if (i + j + k <= n && i + j + k >= n - 1000) ans++;
          if (i + j + k > n) break;
        }
        if (i + j > n) break;
      }
      if (i > n) break;
    }
    cout << ans << endl;
  }
  return 0;
}
