#include <bits/stdc++.h>
long long POW(long long m) {
  long long t = 1;
  for (long long k = 1; k <= m; k++) t *= 4;
  return t;
}
int main() {
  long long n;
  scanf("%I64d", &n);
  if (n == 3) {
    printf("24");
    return 0;
  }
  long long ans = 4 * (3 * POW(n - 3) * 2 + 9 * POW(n - 4) * (n - 3));
  printf("%I64d", ans);
}
