1 #include<cstdio>
2 using namespace std;
3 int f(int n)
4 {
5 if(n==0)
6 return 1;
7 if(n==2)
8 return 3;
9 else
10 return 4*f(n-2)-f(n-4);
11 }
12 int main()
13 {
14 int n;
15 while(scanf("%d",&n)==1&&n!=-1)
16 if(n%2==0)
17 printf("%d\n",f(n));
18 else
19 printf("%d\n",0);
20 return 0;
21 }