#include <bits/stdc++.h>
using namespace std;
long long power(long long n) {
  long long a = 4, res = 1;
  while (n > 0) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
int main() {
  long long t, n, val, val1, val2 = 0;
  cin >> n;
  val = power(n - 3);
  if (n >= 4) {
    val2 = (n - 3) * (9) * (val / 4);
  }
  val1 = 6 * val;
  cout << (4 * (val1 + val2));
  return 0;
}
