#include <bits/stdc++.h>
long long choses(int m, int n) {
  long long sum = 1;
  int i, j;
  for (i = m, j = 1; j <= n; j++, i--) {
    sum = (sum * i) / j;
  }
  return sum;
}
int main(void) {
  int n;
  long long ans = 0, x = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n - 2; i++) x *= 4;
  ans += 2 * 3 * x;
  x = 1;
  for (int i = 1; i <= n - 3; i++) x *= 4;
  ans += (n - 3) * 3 * 3 * x;
  printf("%I64d\n", ans);
  return 0;
}
