# -*- coding: utf-8 -*-
"""
Sum of 4 Integers II
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0096

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def main(args):
    lut = defaultdict(int)
    for a in range(1001):
        for b in range(1001):
            lut[a+b] += 1

    for line in sys.stdin:
        n = int(line)
        ans = 0
        for i in range(n+1):
            ans += lut[i] * lut[n-i]
        print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

