using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();

            int[] memo = new int[2001];

            for (int i = 0; i <= 1000; i++)
            {
                for (int j = 0; j <= 1000; j++)
                {
                    memo[i + j]++;
                }
            }

            string input;

            while (!string.IsNullOrEmpty(input = Console.ReadLine()))
            {
                int n = int.Parse(input);
                int m = Math.Min(n, 2000);
                int ans = 0;

                for (int i = m, j = 0; i >= 0; i--, j++)
                {
                    ans += memo[i] * memo[j];
                }
                sb.AppendLine(ans.ToString());
            }
            Console.Write(sb);
        }
    }
}