#include using namespace std; int n, nr = 0, v[15]; void ch() { int x = 1; /*for(int i = 1; i <= n; ++i) cout << v[i] << ' '; cout << '\n';*/ while(x < n-x+1) { if(v[x] != v[n-x+1]) { nr += 2; return; } ++x; } nr += 1; } void bk(int x) { if(x > n) ch(); else for(int i = 0; i < 4; ++i) if(v[x-1] != (i+2)%4 || x == 1) { v[x] = i; bk(x+1); } } int main() { cin >> n; --n; bk(1); if(!nr) cout << 1; else cout << nr/4+1; }