n = int(input()) res_list = [2] for i in range(1, n): num = res_list[i-1] + 3 res_list.append(num) output = sum(res_list) print(output)