import numpy as np import math N=input() n=int(N) x=pow(10,n) x1=2*x a=np.floor(x1/7) y=a%10 y1=int(y) print(y1)