#include #include int main() { int p;scanf("%d", &p); printf("%d\n", pow(10,p) - 2*pow(9,p)/3-1); return 0; }