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