#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10000000000")
#pragma GCC optimize("O3")
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000007LL;
const long long INF2 = 1000000007LL * 1000000007LL;
const long double EPS = 1e-9;
const int SIZE = 300100;
mt19937 rng(time(0));
uniform_int_distribution<int> uid(-1000000000, 1000000000);
long long d[800][10], u[800][10];
long long C(long long n, long long k) {
  if (k > n) return 0;
  if (k == n) return 1;
  if (k == 1) return n;
  if (u[n][k]) return d[n][k];
  u[n][k] = 1;
  return d[n][k] = C(n - 1, k - 1) + C(n - 1, k);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long border = 2 * 3 * pow(4, (2 * n - 2 - n - 1));
  long long cnt = 2 * n - 2 - n + 1 - 2;
  long long center = cnt * 3 * 3 * pow(4, (2 * n - 2 - n - 2));
  cout << (border + center) * 4;
  return 0;
}
