#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, second = 0;
  cin >> n;
  second = second + 2 * 3 * pow(4, n - 2);
  second = second + (n - 3) * 9 * pow(4, n - 3);
  cout << second;
  return 0;
}
