4873: Parking Lot 停车场

内存限制:256 MB 时间限制:2 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:3 通过:3

题目描述

为了快速聘请高技能专家,一家新的 IT City 公司采取了前所未有的举措。每个员工都获得了一辆汽车,员工可以选择四种不同的汽车品牌之一。

办公室前的停车场由一排(2n - 2)停车位组成。不幸的是,汽车总数大于停车场容量。此外,每个品牌的汽车数量甚至大于停车位的数量!这就是为什么停车场上从来没有免费停车位的原因。

看着直线的汽车,公司首席执行官认为,如果停车场恰好包含n辆相同品牌的连续汽车,它会更漂亮。帮助首席执行官确定以这种方式填充停车场的方法数量。
To quickly hire highly skilled specialists one of the new IT City companies made an unprecedented move. Every employee was granted a car, and an employee can choose one of four different car makes.
The parking lot before the office consists of one line of (2n-2) parking spaces. Unfortunately the total number of cars is greater than the parking lot capacity. Furthermore even amount of cars of each make is greater than the amount of parking spaces! That's why there are no free spaces on the parking lot ever.
Looking on the straight line of cars the company CEO thought that parking lot would be more beautiful if it contained exactly n successive cars of the same make. Help the CEO determine the number of ways to fill the parking lot this way.
Input
The only line of the input contains one integer n (3≤n≤30) − the amount of successive cars of the same make.
Output
Output one integer − the number of ways to fill the parking lot by cars of four makes using the described way.
Examples
Input
3
Output
24
Note
Let's denote car makes in the following way: A − Aston Martin, B − Bentley, M − Mercedes-Maybach, Z − Zaporozhets. For n=3 there are the following appropriate ways to fill the parking lot: AAAB AAAM AAAZ ABBB AMMM AZZZ BBBA BBBM BBBZ BAAA BMMM BZZZ MMMA MMMB MMMZ MAAA MBBB MZZZ ZZZA ZZZB ZZZM ZAAA ZBBB ZMMM
Originally it was planned to grant sport cars of Ferrari, Lamborghini, Maserati and Bugatti makes but this idea was renounced because it is impossible to drive these cars having small road clearance on the worn-down roads of IT City.

输入格式

输入的唯一一行包含一个整数 n3 ≤ n ≤ 30) — 相同品牌的连续汽车的数量。

输出格式

输出一个整数 — 使用所述方式的四辆汽车填充停车场的方式数。

输入样例 复制

3

输出样例 复制

24

数据范围与提示

让我们用以下方式表示汽车制造:A — 阿斯顿马丁,B — 宾利,M — 梅赛德斯-迈巴赫,Z — 扎波罗热。对于 n = 3,有以下适当的方法来填充停车场: AAAB AAAM AAAZ ABBB AMMM AZZZ BBBA BBBM BBBZ BAAA BMMM BZZZ MMMA MMMB MMMZ MAAA MBBB MZZZ ZZZA ZZZB ZZZM ZAAA ZBBB ZMMM

最初计划授予法拉利,兰博基尼,玛莎拉蒂和布加迪制造的跑车,但这个想法被放弃了,因为在IT City破旧的道路上不可能驾驶这些道路间隙很小的汽车。