#include<iostream>
#include<algorithm>
using namespace std;

int main() {
	int n;
	while(cin>>n)
	{
		int c=0;
		for(int i=0;i<=n&&i<=1000;i++)for(int j=0;j<=n&&j<=1000;j++)for(int k=0;k<=n&&k<=1000;k++)
		{
			if(n-i-j-k>=0&&n-i-j-k<=1000)c++;
		}
		cout<<c<<endl;
	}
	return 0;
}