# -*- coding:utf-8 -*- pd = [2, 3, 5, 7, 11, 13] cd = [4, 6, 8, 9, 10, 12] if __name__ == '__main__': k = int(input()) is_divisible_into_k = lambda n: n % k == 0 pdf = filter(is_divisible_into_k, pd) cdf = filter(is_divisible_into_k, cd) cnt = 0 for p in pdf: for c in cdf: if p * c == k: cnt += 1 print(cnt / (len(pd) * len(cd)))