#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int ans = 4 * (n - 3) * 9;
  long long int f = ((long long int)1 << (2 * n - 6));
  if (f != 1) ans *= f / 4;
  ans += 4 * (2 * 3 * f);
  cout << ans;
}
