import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); String tmp = "142857"; if (N == 0) System.out.print(0); else { System.out.print("0."); for (int i = 0; i < N / 6; ++i) System.out.print(tmp); for (int i = 0; i < N % 6; ++i) System.out.print(tmp.charAt(i)); } } }