#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define INF (2 << 28)
#define fr first
#define sc second
using namespace std;

typedef long long ll;
typedef pair<int, int> iP;

int sum[1100000];

int main(){

  int n, cnt = 0;

  for(int i = 0; i <= 1000; i++) {
    for(int j = 0; j <= 1000; j++) {
      sum[cnt++] = i + j;
    }
  }

  sort(sum, sum + cnt);
  while(cin >> n){
    int res = 0;
    for(int i = 0; i <= n; i++) {
      res += (upper_bound(sum, sum + cnt, n - i) - lower_bound(sum, sum + cnt, n - i)) *
        (upper_bound(sum, sum + cnt, i) - lower_bound(sum, sum + cnt, i));
    }
    cout << res << endl;
  }
}