while True:
    try:
        n = int(input())
        '''
        # 方法一
        i, lst = -1, []
        for _ in range(n):
            i += 3
            lst.append(i)
        print(sum(lst))
        '''
        # 方法二
        Sum, i = 0, 2
        while n > 0:
            Sum += i
            i += 3
            n -= 1
        print(Sum)
    except:
        break