\problemname{Alien Microwave}
A standard microwave is operated by entering the cooking time as a string
in the form of {\tt hhmmss}, where {\tt hh}, {\tt mm}, and {\tt ss} are two-digit integers
less than $24$, $60$, and $60$, respectively. 
Leading zeros in the string {\tt hhmmss} are omitted.
For example, the cooking time of $3$ minutes is entered as {\tt 300}, though {\tt 0300} or {\tt 00300} is also accepted.

When any of {\tt hh}, {\tt mm}, or {\tt ss}  exceeds the limit, the microwave will not
accept it as a valid cooking time and gives an error. For example, {\tt 75} is
not accepted, nor is {\tt 240000}. Note that for the purpose of this problem,
we assume that zero seconds of cooking time (represented by a sequence of zero or more {\tt 0}'s) is valid.

Sometimes, one might make a mistake by omitting a digit while entering the
cooking time. For example, while entering {\tt 1030} ($10$ minutes and $30$ seconds),
omitting the digit {\tt 3} turns the input time into {\tt 100} ($1$ minute) instead.
Omitting the digit {\tt 1} turns it into {\tt 030} ($30$ seconds). In this case,
omitting any of the four digits will still make the resulting string a valid
cooking time. However, some other strings, while valid cooking times
themselves, can become invalid when {\it exactly} one of the digits is omitted. For example,
{\tt 1700} ($17$ minutes) becomes invalid if either of the zeros is omitted. 
Such strings are called \emph{Error-Prone} cooking times.

Now, imagine some extraterrestrial planet, on which a standard microwave is
operated by a string in the form $a_1a_2a_3 \ldots a_n$, where each of $a_1$, $a_2$,
\ldots, $a_n$ is a two-digit non-negative integer (somehow they also use base $10$) less
than limits $t_1$, $t_2$, \ldots, $t_n$, respectively. The rules of valid and invalid
cooking time still hold. 

Given limits $t_1$, $t_2$, \ldots, $t_n$, find the number of \emph{Error-Prone} cooking times. Note that leading zeros don't change the cooking time, so a time specification like {\tt 066} is the same as {\tt 66}, and should not be counted twice. Also note that $0$ is a legitimate cooking time. 

\pagebreak

\section*{Input}
The first line of input contains an integer $n$ ($1 \le n \leq 9$), which is the number of time types in the alien time scheme.

Each of the next $n$ lines contains an integer $t_i$ ($1 \le t_i \le 100$), which is the number of partitions in the $i^{th}$ time type in the alien scheme.

\section*{Output}
Output a single integer, which is the number of 
\emph{Error-Prone} cooking times without leading zeros.
