N = gets.to_i if N == 0 puts 0 exit end str = '142857' ans = '0.' idx = 0 N.times do ans += str[idx % 6] idx += 1 end puts ans