#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define P pair<int, int>
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define Int long long int
const int N = 1001;

int main() {
  int n;
  while(cin >>n){
    int fir[N * 2];
    memset(fir, 0, sizeof(fir));
    REP(i, N) REP(j, N) ++fir[i + j];

    int ans = 0;
    REP(i, N){
      REP(j, N){
        int cd_sum = i + j;
        if(n - cd_sum >= 0) ans += fir[n - cd_sum];
      }
    }
    cout <<ans <<endl;
  }
  return 0;
}