#include <bits/stdc++.h>
using namespace std;

int n, dp[4001];

int main(){
    fill(dp, dp+4001, 0);
    dp[0] = 1;
    for(int x = 0; x < 4; x++){
        for(int y = 4000; y >= 0; y--){
            int lim = min(1000, y);
            for(int z = 1; z <= lim; z++){
                dp[y] += dp[y-z];
            }
        }
    }
    while(scanf("%d", &n) != EOF){
        printf("%d\n", dp[n]);
    }
    return 0;
}