#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline std::ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  bool first = true;
  os << "[";
  for (unsigned int i = 0; i < v.size(); i++) {
    if (!first) os << ", ";
    os << v[i];
    first = false;
  }
  return os << "]";
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::set<T>& v) {
  bool first = true;
  os << "[";
  for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end();
       ++ii) {
    if (!first) os << ", ";
    os << *ii;
    first = false;
  }
  return os << "]";
}
template <typename T1, typename T2>
inline std::ostream& operator<<(std::ostream& os, const std::map<T1, T2>& v) {
  bool first = true;
  os << "[";
  for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end();
       ++ii) {
    if (!first) os << ", ";
    os << *ii;
    first = false;
  }
  return os << "]";
}
struct FenwickTree {
  int n;
  vector<long long> fenw;
  FenwickTree(int n) {
    this->n = n;
    fenw.assign(n, 0);
  }
  FenwickTree(vector<long long> a) : FenwickTree((int)a.size()) {
    for (int i = 0; i < (int)a.size(); i++) {
      update(i, a[i]);
    }
  }
  long long sum(int r) {
    long long res = 0;
    while (r >= 0) {
      res += fenw[r];
      r = r & (r + 1);
      r--;
    }
    return res;
  }
  long long sum(int l, int r) { return sum(r) - sum(l - 1); }
  void update(int ind, long long val) {
    while (ind < n) {
      fenw[ind] += val;
      ind = ind | (ind + 1);
    }
  }
  void range_add(int l, int r, int val) {
    update(l, val);
    update(r + 1, -val);
  }
};
long long binpow(long long a, long long b) {
  if (b == 0) return 1;
  long long res = binpow(a, b / 2);
  res = res * res;
  if (b & 1) return a * res;
  return res;
}
int solve() {
  long long n;
  cin >> n;
  cout << (2 * 3 * binpow(4, n - 2)) + ((n - 3) * 9 * binpow(4, n - 3));
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) solve();
  return 0;
}
