#include <cstdio> long long int memo[55]; long long int f(int n) { memo[1] = 3; memo[2] = memo[3] = 6; for(int i = 4; i <= n; ++ i) { memo[i] = memo[i - 1] + 2 * memo[i - 2]; } return memo[n]; } int main() { long long int n; while(scanf("%lld", &n) != EOF) { printf("%lld ", f(n)); } return 0; }