int main(){
long long a[51];
a[0]=0;
a[1]=3;
a[2]=6;
a[3]=6;
for(int i=4;i<=50;i++){
a[i]=a[i-1]+a[i-2]*2;
}
int n;
while(scanf("%d",&n)!=EOF){
printf("%lld\n",a[n]);
int main(){
long long a[51];
a[0]=0;
a[1]=3;
a[2]=6;
a[3]=6;
for(int i=4;i<=50;i++){
a[i]=a[i-1]+a[i-2]*2;
}
int n;
while(scanf("%d",&n)!=EOF){
printf("%lld\n",a[n]);