#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 9e18;
const int MX = 2e5 + 5;
const long double PI = acos((long double)-1);
const int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[8] = {1, 0, -1, 0, 1, -1, -1, 1};
void setIO(string name = "") {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if ((int)(name).size()) {
    freopen((name + ".in").c_str(), "r", stdin);
    freopen((name + ".out").c_str(), "w", stdout);
  }
}
int main() {
  setIO();
  long long n;
  cin >> n;
  cout << 24LL * (long long)pow(4LL, n - 3LL) +
              36LL * (n - 3LL) * (long long)pow(4LL, n - 4LL);
}
