等差求和公式 S = na +n(n-1)/2d 或者 S=(a1 +an)/2n

while True:
    try:
        n = int(input())
        a = 2
        d = 3
        s = n * a + n * (n - 1) / 2 * d
        print(int(s))
    except:
        break