#include<bits/stdc++.h> using namespace std; long long tot=0; void f(char n,char a,char b,char c) { if(n==1){ tot++; tot++; } else{ f(n-1,a,c,b); tot++; tot++; f(n-1,b,a,c); } } int main() { int n; cin>>n; f(n,'A','B','C'); cout<<tot; return 0; }