#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long ans = 24;
  for (int i = 0; i < n - 3; i++) {
    ans *= 4;
  }
  if (n > 3) {
    long long ans1 = 36;
    for (int i = 0; i < n - 4; i++) {
      ans1 *= 4;
    }
    ans1 *= n - 3;
    ans += ans1;
  }
  cout << ans << endl;
}
