Codeforces Round 513 by Barcelona Bootcamp (rated, Div. 1 + Div. 2)
A
Phone Numbers
Codeforces
800
原题
←B →
翻译中…

Let's call a string a phone number if it has length 11 and fits the pattern "8xxxxxxxxxx", where each "x" is replaced by a digit.

翻译中…

For example, "80123456789" and "80000000000" are phone numbers, while "8012345678" and "79000000000" are not.

翻译中…

You have $n$ cards with digits, and you want to use them to make as many phone numbers as possible. Each card must be used in at most one phone number, and you don't have to use all cards. The phone numbers do not necessarily have to be distinct.

翻译中…

Input

翻译中…

The first line contains an integer $n$ — the number of cards with digits that you have ($1 \leq n \leq 100$).

翻译中…

The second line contains a string of $n$ digits (characters "0", "1", ..., "9") $s_1, s_2, \ldots, s_n$. The string will not contain any other characters, such as leading or trailing spaces.

翻译中…

Output

翻译中…

If at least one phone number can be made from these cards, output the maximum number of phone numbers that can be made. Otherwise, output 0.

翻译中…

Note

翻译中…

In the first example, one phone number, "8000000000", can be made from these cards.

翻译中…

In the second example, you can make two phone numbers from the cards, for example, "80123456789" and "80123456789".

翻译中…

In the third example you can't make any phone number from the given cards.

翻译中…

样例

Input #1
11
00000000008
Output #1
1
InputCopy OutputCopy
Input #2
22
0011223344556677889988
Output #2
2
InputCopy OutputCopy
Input #3
11
31415926535
Output #3
0
InputCopy OutputCopy
题目信息
题号
1060A
时间限制
2 s
内存限制
512 MB
标签
暴力

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。