

#include <cstdio>
long long int memo[50];
long long int f(long long int n)
{
memo[1] = 3;
memo[2] = 8;
for(long long int i = 3; i <= n; ++ i)
{
memo[i] = 2 * memo[i - 1] + 2 * memo[i - 2];
}
return memo[n];
}
int main()
{
int n;
while(scanf("%d", &n) != EOF)
{
printf("%lld
", f(n));
}
return 0;
}