#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T& a, const T& b) {
  if (b > a) a = b;
}
template <class T>
inline void chmin(T& a, const T& b) {
  if (b < a) a = b;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << '(' << p.first << ", " << p.second << ')';
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  copy(v.begin(), v.end(), ostream_iterator<T>(os, " "));
  return os;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  const int MAX = 4000;
  vector<long long> cnt(MAX + 1, 0);
  for (int i = 0; i <= MAX; ++i) {
    for (int j = 0; j <= MAX; ++j) {
      if (i + j > MAX) break;
      ++cnt[i + j];
    }
  }
  for (int n; cin >> n;) {
    long long ans = 0;
    for (int i = 0; i <= n; ++i) ans += cnt[i] * cnt[n - i];
    cout << ans << endl;
  }
  return EXIT_SUCCESS;
}
