import std.algorithm; import std.array; import std.ascii; import std.container; import std.conv; import std.math; import std.numeric; import std.range; import std.stdio; import std.string; import std.typecons; void log(A...)(A arg) { stderr.writeln(arg); } int size(T)(in T s) { return cast(int)s.length; } void main() { auto P = readln.chomp.to!int; auto f = new long[][](P + 1, 3); f[1][0] = 4; f[1][1] = 4; f[1][2] = 4; for (int i = 1; i < P; i++) { for (int j = 0; j < 3; j++) { f[i + 1][j] = 10L ^^ i + 3 * (f[i][0] + f[i][1] + f[i][2]); } } writeln(f[P][0] - 1); }