#include <bits/stdc++.h>
using namespace std;
long long int bin(int a, int b) {
  if (b == 0) return 1;
  long long int x = bin(a, b / 2);
  if (b % 2)
    return x * x * a;
  else
    return x * x;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n > 3) {
    long long int t1 = bin(2, 2 * (n - 3));
    long long int t2 = t1 << 2;
    cout << t2 * 3 * 2 + t1 * 3 * 3 * (n - 3);
  } else
    cout << 24 << endl;
}
