#include <cstdio>
#include <algorithm>

#define rep(i, n) for(int i = 0; i < n; ++i)

using namespace std;

long long dp[4001][5];

int main(){
	rep(k, 1001){
		rep(i, 4001){
			for(int j = 1; j <= 4; ++j){
				if(i == 0){
					dp[i][j] = 1;
				}
				else if(j == 1){
					dp[i][j] = i <= k;
				}
				else if(k == 0){
					dp[i][j] = 0;
				}
				else if(i > k){
					dp[i][j] = dp[i - 1][j] - dp[i - k - 1][j - 1] + dp[i][j - 1];
				}
				else{
					dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
				}
			}
		}
	}

	int n;
	while(scanf("%d", &n) != EOF){
		printf("%lld\n", dp[n][4]);
	}
	return 0;
}