x = input() x_Ten = 1 count = 0 seven = 7 for i in range(int(x)): x_Ten = x_Ten * 10 #print (x_Ten) while seven < x_Ten: count += 1 seven += 7 #print (count) Answer = count / x_Ten print (Answer)