#include <bits/stdc++.h>
using namespace std;
long long dr[] = {-1, 1, 0, 0};
long long dc[] = {0, 0, 1, -1};
long long gcd(long long a, long long b);
long long exp(long long x, long long y, long long p);
long long exp(long long x, long long y);
void InverseofNumber();
void InverseofFactorial();
void factorial();
long long Binomial(long long n, long long R);
long long factorialNumInverse[((long long)3e5 + 20) + 1];
long long naturalNumInverse[((long long)3e5 + 20) + 1];
long long fact[((long long)3e5 + 20) + 1];
void fileIO() {}
int main() {
  clock_t start, end;
  start = clock();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long e = exp(4, n - 3);
  long long ee = e / 4;
  long long ans = 1LL * 2 * 3 * 4 * e + 1LL * (n - 3) * 4 * 9 * ee;
  cout << ans;
  end = clock();
  double timeTaken =
      (double(end - start) * (double(1000))) / double(CLOCKS_PER_SEC);
  cerr << "timeTaken"
       << "=" << timeTaken << "\n";
  return 0;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long exp(long long x, long long y, long long p) {
  long long res = 1;
  while (y) {
    if (y % 2) res = (res * x % p) % p;
    x = (x * x) % p;
    y /= 2;
  }
  return res;
}
long long exp(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y % 2) res = (res * x);
    x = (x * x);
    y /= 2;
  }
  return res;
}
void InverseofNumber() {
  naturalNumInverse[0] = naturalNumInverse[1] = 1;
  for (long long i = 2; i <= ((long long)3e5 + 20); i++)
    naturalNumInverse[i] = naturalNumInverse[((long long)1e9 + 7) % i] *
                           (((long long)1e9 + 7) - ((long long)1e9 + 7) / i) %
                           ((long long)1e9 + 7);
}
void InverseofFactorial() {
  factorialNumInverse[0] = factorialNumInverse[1] = 1;
  for (long long i = 2; i <= ((long long)3e5 + 20); i++)
    factorialNumInverse[i] =
        (naturalNumInverse[i] * factorialNumInverse[i - 1]) %
        ((long long)1e9 + 7);
}
void factorial() {
  fact[0] = 1;
  for (long long i = 1; i <= ((long long)3e5 + 20); i++)
    fact[i] = (fact[i - 1] * i);
}
long long Binomial(long long n, long long R) {
  long long ans = ((fact[n] * factorialNumInverse[R]) % ((long long)1e9 + 7) *
                   (factorialNumInverse[n - R]) % ((long long)1e9 + 7)) %
                  ((long long)1e9 + 7);
  return ans;
}
