// yukicoder: No.220 世界のなんとか2 // bal4u 2019.8.25 #include typedef long long ll; ll a[22] = {0,3}; int main() { int i, P; ll b10, ans; scanf("%d", &P); if (P == 1) ans = 3; else { b10 = 1; for (i = 2; i <= P; i++) { b10 *= 10; a[i] = 9*(a[i-1]+1)+b10-1; } ans = a[P]; } printf("%lld\n", ans); return 0; }