\problemname{Simple Cron Spec}
A \emph{Cron Spec} is used by Linux to specify when to repeatedly execute a certain job. For this problem, consider a \emph{Simple Cron Spec} that defines when a job needs to be run within a single day. A \emph{Simple Cron Spec} has three space separated tokens:

\centerline{$hours$ $minutes$ $seconds$}

that specify at which hours/minutes/seconds a job will be run. Hour values are $0$-$23$, minute and second values are $0$-$59$.

Each token consists of a single integer value, a value range (two values
separated by a dash `{\tt -}'), a comma-separated list of multiple values and/or
value ranges, or an asterisk (`{\tt *}'). A value range represents all integer values between the low
and high value, inclusive. An asterisk is a special token that represents
all possible values. The specified values in any comma separated list must be non-overlapping.

For example, the specification:

\centerline{\tt * 30 20,25,30-33}

says the job will be run every hour, at minute $30$, and second $20$, $25$, $30$, $31$, $32$, and $33$,
for a total of $24 \times 1 \times 6 = 144$ times each day.

Given a list of \emph{Simple Cron Specs}, determine two things: First, the number of seconds in the day that at least one job will start, and second, the total number of job starts during the day. Note that if a single job starts 24 times in a day, that counts as 24 job starts.

\pagebreak

\section*{Input}
The first line of input contains a single integer $n$ ($1 \le n \le 100$), which is the number of \emph{Simple Cron Specs} that follow.

Each of the next $n$ lines contains three strings $h$, $m$ and $s$. These are the hours, minutes, and seconds specifications of the \emph{Simple Cron Specs}. Each $h$, $m$ and $s$ consists of either a single star (`{\tt *}'), or a comma-separated list of one or more values or value ranges (two values separated by `{\tt -}'). The values/ranges are guaranteed to be within the appropriate limits ($0$ to $23$ for hours, $0$ to $59$ for minutes and seconds), and are guaranteed to not overlap. All range specifications are guaranteed to consist of two distinct values, smallest first. All values specified in a comma-separated list are guaranteed to be in strictly increasing order. The whole is guaranteed to be a legitimate \emph{Simple Cron Spec}. The only spaces in the line will be a single space between $h$ and $m$, and a single space between $m$ and $s$.

\section*{Output}
Output two space separated integers. The first is the number of seconds in the $24$ hour day with at least one job start, and the second is the total number of job starts.
