#include using namespace std; int n, nr = 0, v[15]; void ch() { int x = 1; while(v[x] == v[n-x+1] && x >= n-x+1) ++x; if(x > n-x+1) nr += 1; else nr += 2; } void bk(int x) { if(x > n) ch(); else for(int i = v[x-1]; i < 3; ++i) { v[x] = i; bk(x+1); } } int main() { v[0] = 1; cin >> n; --n; bk(1); cout << nr; }