int t(int a, int b, int c) { int f = 1; if (a) { int d, e = a&~b&~c; for (f = 0; d = e&-e; e -= d) f += t(a-d, (b+d)*2, (c+d)/2); } return f; } int main(int q) { scanf("%d", &q); printf("%d\n", t(~(~0<<q), 0, 0)); return 0; }