A standard microwave is operated by entering the cooking time as a string
in the form of `hhmmss`, where `hh`, `mm`, and `ss` are two-digit integers
less than 24, 60, 60, respectively. Leading zeroes in the string `hhmmss`
are typically omitted, i.e., the cooking time of 3 minutes, for example,
is entered as `300`, though `0300` or `00300` is also accepted.

When any of `hh`, `mm`, or `ss` exceeds the limit, the microwave won't
accept it as a valid cooking time and gives an error. For example, `75` is
not accepted, nor is `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 `0`) is valid.

Sometimes, one might make a mistake by omitting a digit while entering the
cooking time. For example, while entering `1030` (10 minutes and 30 seconds),
omitting the digit `3` turns the input time into `100` (1 minute) instead.
Omitting the digit `1` turns it into `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 time
themselves, can become invalid when one of the digits is omitted. For example,
`1700` (17 minutes) becomes invalid if any of the zeroes is omitted. Such
strings are called *error-prone* cooking times.

Now, imagine some extraterrestrial planet, on which a standard microwave is
operated by a string in the form `a1a2a3...ak`, where each of `a1`, `a2`,
..., `ak` is two-digit integers (yes, somehow they also use base 10) less
than `n1`, `n2`, ..., `nk`, respectively. The rules of valid and invalid
cooking time still hold. Given `n1`, ..., `nk`, find the number of nonzero
*error-prone* cooking times without leading zeroes.

Input format:
k
n1
n2
...
nk

Output format:
Print, on a single line, the number of *error-prone* cooking times.

Comments:
There are several things we can tune to make the problem easier or harder.
* Small k (say <= 6) makes the problem a div 2 gimme. Large k, on the other
hand, will require a DP solution.
* If only the first digit of `ni` can be nonzero, a closed form solution
exists.
* Relaxing the two-digit constraint on the `ai`s will make it harder to code,
without changing the core idea.