#include <bits/stdc++.h>
#pragma comment(linker, "/stack:640000000")
using namespace std;
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
const double PI = acos(-1.0);
template <class T>
inline T gcd(T a, T b) {
  return (b) == 0 ? (a) : gcd((b), ((a) % (b)));
}
template <class T>
inline T lcm(T a, T b) {
  return ((a) / gcd((a), (b)) * (b));
}
template <typename T>
string NumberToString(T Number) {
  ostringstream second;
  second << Number;
  return second.str();
}
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int t, n, m;
long long bigmod(long long b, long long p) {
  if (p < 0) return 1;
  long long res = 1, x = b;
  while (p) {
    if (p & 1) res = (res * x);
    x = (x * x);
    p >>= 1;
  }
  return res;
}
int main() {
  while (~scanf("%d", &n)) {
    long long ans = 0;
    ans += 4 * 3 * bigmod(4, n - 3) * 2;
    ans += 4 * (3 * 3) * bigmod(4, n - 4) * (n - 3);
    printf("%lld\n", ans);
  }
  return 0;
}
