print([a=5G.modPow(2**300,b=10**300)*2-1,b-1,b-a][System.in.read()%10%3])