import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); double[] dp = new double[6 * n + 1]; Arrays.fill(dp, 0); Set s = new TreeSet<>(); dp[1] = 1; s.add(1); while(!s.isEmpty()) { int x = s.iterator().next(); s.remove(x); if(x >= n) break; s.add(x * 2); s.add(x * 3); s.add(x * 4); s.add(x * 5); s.add(x * 6); dp[x * 2] += dp[x] * 1.0 / 5.0; dp[x * 3] += dp[x] * 1.0 / 5.0; dp[x * 4] += dp[x] * 1.0 / 5.0; dp[x * 5] += dp[x] * 1.0 / 5.0; dp[x * 6] += dp[x] * 1.0 / 5.0; } System.out.println(dp[n]); } // there is an extra-log factor because of the usage of HashSet :) // clearly standard double precision is insufficient for representing numbers with high precision after the decimal point // but you could use BigDecimal // but this is still not enough :), best way is to represent the rational numbers in modulo large 'prime number'. }