#include <bits/stdc++.h>
using namespace std;
long long power(long long dummy, long long n) {
  long long ret = 1;
  for (long long i = 0; i < n; i++) {
    ret *= 4;
  }
  return ret;
}
int main() {
  long long n;
  cin >> n;
  long long ans = 2 * (3 * power(4, n - 3));
  if (n > 3) {
    ans += (2 * n - 2 - n + 1 - 2) * 9 * (power(4, n - 4));
  }
  ans *= 4;
  cout << ans;
  return 0;
}
