p=int(input()) print(10**p-9**p+9**p//3-1)