# coding: utf-8 #yuki_220 p=int(raw_input()) res=10**p-1-9**p*2/3 print res