#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
const double pi = acos(-1);
long long powMod(long long x, long long y) {
  long long p = 1;
  while (y) {
    if (y % 2) {
      p = (p * x) % mod;
    }
    y /= 2;
    x = (x * x) % mod;
  }
  return p;
}
long long invMod(long long x) { return powMod(x, mod - 2); }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long nCr(long long n, long long r) {
  if (n < r) return 0;
  long long nfac = 1;
  long long dfac = 1;
  for (long long i = n - r + 1; i <= n; i++) {
    nfac = (nfac * i) % mod;
  }
  for (long long i = 1; i <= r; i++) {
    dfac = (dfac * invMod(i)) % mod;
  }
  return (nfac * dfac) % mod;
}
int solve() {
  mod = mod * mod;
  int n;
  cin >> n;
  long long ans = 0;
  ans = 2LL * 12LL * powMod(4, n - 3) + (n - 3LL) * 36LL * powMod(4, n - 4);
  cout << ans << endl;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
  return 0;
}
