first = int(input()); syo = int(first/6); amari = int(first%6); result = "" if syo > 0: for num in range(syo): result = result + "142857" elif first ==0: result = result + "0" if amari == 1: result = result + "1" if amari == 2: result = result + "14" if amari == 3: result = result + "142" if amari == 4: result = result + "1428" if amari == 5: result = result + "14285" if first > 0: result = "0."+result print(result)