N=int(input ()) Q=N//2 R=N%2 M=0 T=1 for i in range(Q): M+=T T*=10 T//=10 T*=7 if R==1: M-=1 M//=10 M+=T print (M)