import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N, L = map(int, readline().split()) L *= 60 comb = np.zeros((60, 60), np.int64) comb[0, 0] = 1 for n in range(1, 60): comb[n] += comb[n - 1] comb[n, 1:] += comb[n - 1, :-1] def convert(s): minute, second = map(int, s.split(b':')) return 60 * minute + second S = tuple(map(convert, read().split())) full = sum(S) if L >= full: print(N) exit() dp = np.zeros((N + 1, L + 1), np.int64) dp[0, 0] = 1 def add(dp, x): if x > L: return for n in range(N, 0, -1): dp[n, x:] += dp[n - 1, :-x] def remove(dp, x): if x > L: return for n in range(1, N + 1): dp[n, x:] -= dp[n - 1, :-x] for x in S: add(dp, x) expected = 0 for x in S: remove(dp, x) p = 0 for n in range(N): p += dp[n, :L].sum() / comb[N - 1, n] p /= N expected += p add(dp, x) print(expected)