def total_investment(n):
    total = 0
    for i in range(1, n + 1):
        year = (i - 1) // 12 + 1       # 第几年
        month = (i - 1) % 12 + 1       # 当年第几个月
        invest = year + (month - 1)     # 该月投入
        total += invest
    return total


if __name__ == "__main__":
    n = int(input("请输入月数n："))
    print(f"第{n}个月结束时，总共投入了{total_investment(n)}万元")
