#include <iostream>
using namespace std;


int a,b,c,d,n;
int ans;
int main(){

  while(cin >> n){
    int m = min(1000, n);
    ans = 0;
    for(a = 0 ; a <= m  ; a++){
      for(b = 0 ; a + b <= m ; b++){
	for(c = 0 ; a + b + c <= m ; c++){
	  if( n-a-b-c <= 1000) ans++;
	}
      }
    }
    cout << ans << endl;
  }
  return 0;
}