#include <bits/stdc++.h>
//#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e19;
const int MOD = 1e9 + 7;

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    while(cin >> n) 
    {
        int ans = 0;
        vector<vector<int>> dp(5, vector<int>(n+5, 0));
        dp[0][0] = 1;
        REP(i, 4)
        {
            REP(j, n+1)
            {
                REP(k, 1001)
                {
                    if(j - k >= 0 && dp[i][j-k] != -1) dp[i+1][j] += dp[i][j-k];
                }
            }
        }
        cout << dp[4][n] << endl;
    }
    
}
