#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  if (n == 3)
    cout << 24;
  else {
    cout << (36 * n - 12) * ((long long int)(pow(4, n - 4)));
  }
  return 0;
}
