#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long int binPow(long long int a, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) {
      res = res * a;
    }
    a = a * a;
    n >>= 1;
  }
  return res;
}
long long int binMod(long long int a, long long int n, long long int modulus) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) {
      res = (res * a) % modulus;
    }
    a = (a * a) % modulus;
    n >>= 1;
  }
  return res;
}
void solve() {
  int n;
  cin >> n;
  long long int result;
  result = 2 * 4 * 3 * binPow(4, n - 3) * 1LL;
  result += (n - 3) * 4 * 9 * binPow(4, n - 4);
  cout << result << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
