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.


-----Examples-----
Input
11
00000000008

Output
1

Input
22
0011223344556677889988

Output
2

Input
11
31415926535

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.

Difficulty: competition

Starter code:

Solutions:
n=int(input())
s=list(input())
print(min(s.count('8'),n//11))

def main():
    n = int(input())
    s = input()
    cnt = 0
    for i in s:
        if i == '8':
            cnt += 1
    print(min(cnt, n // 11))

main()

n = int(input())
s = input()

cnt8 = 0
for x in s:
    if(x == '8'):
        cnt8 += 1

print(min(cnt8, n // 11))


from collections import Counter

n = int(input())
a = list(input())
c = Counter(a)
print(min(n // 11, c['8']))

n=int(input())
r=input()
c=0
for i in r:
	if i=='8':
		c=c+1
print (min(n//11,c))

#!/usr/bin/env python3
n = int(input())
s = input()
a = s.count('8')
b = n - a
cnt = 0
while a >= 1 and a + b >= 11:
    a -= 1
    b -= 10
    if b < 0:
        a += b
        b = 0
    cnt += 1
print(cnt)


n = int(input())
s = input()

for i in range(n, -1, -1):
    if s.count('8') < i:
        continue
    if (len(s) - i) // 10 < i:
        continue
    print(i)
    break


num = int(input())
digs = input()
num_8 = sum(1 for i in digs if i == "8")
print(min(num_8, num // 11))

n=int(input())
s=input()
c=0
for i in s:
	if i=='8':
		c+=1
cc=n//11
print(min(cc,c))

n = int(input())
s = input()
eight = 0
for x in s:
    if x == '8': eight+=1
print(min(eight, n//11))

n = int(input())
c = input().count('8')
print(min(n // 11, c))

n = int(input())
s = input()
k = s.count("8")
l = n - k
if k <= l//10: print(k)
else:
    while k > l//10:
        k -= 1
        l += 1
    print(min(k, l//10))


n=int(input())
s=input()
print(min(sum([1 if i == '8' else 0 for i in s]), len(s)//11))


import sys

n=int(sys.stdin.readline())
s=input()

x=s.count("8")

print(min(n//11,x))


n = int(input())
a = [int(_) for _ in input()]

num = len([_ for _ in a if _ == 8])
length = len(a)

print(min(length // 11, num))


N = int(input())

ipt = input()

def checker(ipt):
    if "8" in ipt:
        if len(ipt) >= 11:
            return min(len(ipt)//11, ipt.count("8"))
    return 0

print(checker(ipt))

n=int(input())
l=list(input())
p=n//11
print(min(l.count("8"),p))

N = int(input())
s = input()
eights = s.count("8")
m = len(s) // 11

print(min(eights, m))

n=int(input())
s=input()
c=0
for i in range(0,len(s)):
    if(s[i]=='8'):
        c=c+1
k=len(s)//11
print(min(c,k))


n=int(input())
c=0
s=input()
for i in s:
    if i=='8':c+=1
print(min(n//11,c))


# coding: utf-8

# In[9]:

import collections
n = int(input())
s = input()
c= collections.Counter(s)
print(min(c['8'], len(s)//11))



n=int(input())
a=list(map(int,list(input())))
c8=a.count(8)
t=n//11
if(t>=c8):
	print(c8)
else:
	print(t)

n=int(input())
ch=input()
print(min(n//11,ch.count('8')))