#include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		int ans=0;
		for(int cut=0;cut<=n;cut++){
			int count1=0;
			for(int i=0;i<=min(1000,cut);i++){
				count1++;
			}
			int count2=0;
			for(int i=0;i<=min(1000,n-cut);i++){
				count2++;
			}
			ans+=count1*count2;
		}
		cout<<ans<<endl;
	}
	return 0;
}