#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 2e5 + 10;
int main() {
  int n;
  cin >> n;
  long long ans = 2 * 4 * 3 * (1LL << (2 * n - 6)) +
                  (n - 3) * 4 * 3 * 3 * (1LL << (2 * n - 8));
  cout << ans << endl;
  return 0;
}
