cs
#include<stdio.h>
void main()
{
int n, i;
long long arr[51];
while (~scanf_s("%d", &n))
{
arr[0] = 3, arr[1] = 6, arr[2] = 6;
for (i = 3; i < n; i++)arr[i] = arr[i - 1] + arr[i - 2] * 2;
printf("%lld\n", arr[n - 1]);
}
}