#include <bits/stdc++.h>
using namespace std;
int isPrime(long long k) {
  if (k <= 1) {
    return 0;
  }
  if (k == 2) {
    return 1;
  }
  if (k % 2 == 0) {
    return 0;
  }
  long long i = 3;
  while (i * i <= k) {
    if (k % i == 0) {
      return 0;
    }
    i += 2;
  }
  return 1;
}
long long binomialCoeff(long long n, long long k) {
  long long C[n + 1][k + 1];
  long long i, j;
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= min(i, k); j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
    }
  }
  return C[n][k];
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  if (n == 3) {
    cout << 24;
  } else {
    cout << (3 * (3 * n - 1) * ((long long)pow((double)4, n - 3)));
  }
  return 0;
}
