#include #include #include using namespace std; #define RREP(i,s,e) for (i = s; i >= e; i--) #define rrep(i,n) RREP(i,n,0) #define REP(i,s,e) for (i = s; i < e; i++) #define rep(i,n) REP(i,0,n) #define INF 100000000 typedef long long ll; typedef unsigned long long ull; ull power(int x, int n) { return n == 0 ? 1 : x * power(x,n-1); } int main() { int i, j, p; ull have3; ull n; cin >> p; have3 = 1; rep (i,p) have3 *= 9; have3 = power(10,p) - have3; n = 3; rep (i,p-1) n *= 9; n--; cout << have3 + n << endl; return 0; }