#include <bits/stdc++.h>
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int m = 3 * n - 1;
    int sum = n - 3;
    long long all = m * 3 * pow(4, sum);
    printf("%lld\n", all);
  }
  return 0;
}
