Translator's note: in Russia's most widespread grading system, there are four grades: 5, 4, 3, 2, the higher the better, roughly corresponding to A, B, C and F respectively in American grading system.

The term is coming to an end and students start thinking about their grades. Today, a professor told his students that the grades for his course would be given out automatically  — he would calculate the simple average (arithmetic mean) of all grades given out for lab works this term and round to the nearest integer. The rounding would be done in favour of the student — $4.5$ would be rounded up to $5$ (as in example 3), but $4.4$ would be rounded down to $4$.

This does not bode well for Vasya who didn't think those lab works would influence anything, so he may receive a grade worse than $5$ (maybe even the dreaded $2$). However, the professor allowed him to redo some of his works of Vasya's choosing to increase his average grade. Vasya wants to redo as as few lab works as possible in order to get $5$ for the course. Of course, Vasya will get $5$ for the lab works he chooses to redo.

Help Vasya — calculate the minimum amount of lab works Vasya has to redo.


-----Input-----

The first line contains a single integer $n$ — the number of Vasya's grades ($1 \leq n \leq 100$).

The second line contains $n$ integers from $2$ to $5$ — Vasya's grades for his lab works.


-----Output-----

Output a single integer — the minimum amount of lab works that Vasya has to redo. It can be shown that Vasya can always redo enough lab works to get a $5$.


-----Examples-----
Input
3
4 4 4

Output
2

Input
4
5 4 5 5

Output
0

Input
4
5 3 3 5

Output
1



-----Note-----

In the first sample, it is enough to redo two lab works to make two $4$s into $5$s.

In the second sample, Vasya's average is already $4.75$ so he doesn't have to redo anything to get a $5$.

In the second sample Vasya has to redo one lab work to get rid of one of the $3$s, that will make the average exactly $4.5$ so the final grade would be $5$.

Difficulty: interview

Starter code:

Solutions:
def read_input():
	return map(int, input().split())

n = int(input())
a = sorted(read_input())

s = sum(a)
i = 0

while 2 * s < 9 * n:
	delta = 5 - a[i]
	s += delta
	i += 1

print(i)

n = int(input())
a = list(map(int, input().split()))
#    0 1 2 3 4 5
c = [0,0,0,0,0,0]
for _ in a:
  c[_] += 1
s = sum(a)
ans = 0
while 2 * s < 9 * n:
  if c[2] > 0:
    s += 3
    c[2] -= 1
    c[5] += 1
    ans += 1
  elif c[3] > 0:
    s += 2
    c[3] -= 1
    c[5] += 1
    ans += 1
  elif c[4] > 0:
    s += 1
    c[4] -= 1
    c[5] += 1
    ans += 1
print(ans)


n = int(input())
ai= list(map(int, input().split()))
ai.sort()
summ = sum(ai)
if summ  / n >= 4.5:
    print(0)
else:
    for i in range(n):
        summ += 5 - ai[i]
        if summ  / n >= 4.5:
            print(i+1)
            break


n=int(input())
arr=list(map(int,input().strip().split(' ')))
arr.sort()
s = sum(arr)
if(s>=4.5*n):
  print(0)
else:
  cnt = 0
  for i in range(n):
    cnt+=1
    s = s-arr[i]+5
    if(s>=4.5*n):
      break
  print(cnt)

from sys import stdin, stdout

n = int(stdin.readline())
values = sorted(list(map(int, stdin.readline().split())))

l, r = -1, n
while r - l > 1:
    m = (l + r) >> 1
    
    if (sum(values[m:]) + 5 * m) * 10 >= 45 * n:
        r = m
    else:
        l = m

stdout.write(str(r))

def main():
    n = int(input())
    def ceil(x):
        if x % 1 == 0:
            return int(x)
        return int(x + 1)
    a = ceil(n * 4.5)
    scores = sorted(list(map(int, input().split())))
    s = sum(scores)
    c = 0
    while s < a:
        s += 5 - scores[c]
        c += 1
    print(c)
    return 0
main()


n = int(input())

grades = [int(x) * 2 for x in input().split()]

res = sum(grades)
target = 9 * len(grades)

grades.sort()

for i, grade in enumerate(grades):
    if res >= target:
        print(i)
        break
    else:
        res += 10 - grade
else:
    print(len(grades))


n = int(input())
a = list(map(int, input().split()))

c = 0
s = sum(a)
if s/n >= 4.5:
	print (c)
else:
	a.sort()
	for i in range(len(a)):
		c+=1
		s+=(5-a[i])
		a[i] = 5
		if (s/n>=4.5):
			break
	print (c)


n = int(input())
a = sorted(list(map(int, input().split())))


for i in range(n + 1):
    cur_sum = 5 * i + sum(a[i:])

    if cur_sum * 10 >= n * 45:
        print(i)
        break




n = int(input())
a = list(map(int, input().split()))
a.sort()
total = sum(a)
need = 4.5 * n
i = 0
while total < need:
	total += (5 - a[i])
	i += 1
print(i)

n = int(input())
r = 4.5*n
t = sorted([int(i) for i in input().split()])

c = 0
s = sum(t)
while(s < r):
    s += 5 - t[c]
    c += 1

print(c)

n = int(input())
a = list(map(int,input().split()))
a.sort()
c = 0
while sum(a)/len(a) < 4.5:
    a[a.index(min(a))] = 5
    c+=1
print(c)


n = int(input().strip())
a = sorted(list(map(int, input().strip().split())))
r = 0

while True:
    mean = sum(a) / n
    if round(mean) >= 5 or mean == 4.5:
        break

    r += 1
    a[0] = 5
    a.sort()

print(r)


n = int(input())

s = list(map(int, input().strip().split()))

s = sorted(s)

mean = sum(s) / len(s)

l = 0
while mean < 4.5:
    s[l] = 5
    l += 1
    mean = sum(s) / len(s)

print(l)


n = int(input())
grades = list(map(int, input().split()))
grades.sort()
cur = sum(grades) / len(grades)
i = 0
while cur < 4.5:
	grades[i] = 5
	cur = sum(grades) / len(grades)
	i += 1
print(i)


def go():
    n = int(input())
    a = sorted([int(i) for i in input().split(' ')])
    s = sum(a)
    if s / n >= 4.5:
        return 0
    c = 0
    for i in range(n):
        s -= a[i]
        a[i] = 5
        s += 5
        c += 1
        if s / n >= 4.5:
            return c
print(go())


n = int(input())
labs = [ int(a) for a in input().split() ]

labs.sort()

redo = 0
while sum(labs)/len(labs) < 4.5:
    labs[redo] = 5
    redo += 1

print(redo)




n = int(input())

tab = sorted([int(x) for x in input().split()])


s = sum(tab)

result = 0

for i in range(n):
    if 2 * s >= 9 * n:
        break
    result += 1
    s -= tab[i]
    s += 5

print(result)


n = int(input())
a = list(map(int, input().split()))

s = sum(a)
ans = 0
while 2 * s / n < 9:
    m = min(a)
    a.remove(m)
    a.append(5)
    s += 5 - m
    ans += 1

print(ans)


#JMD
#Nagendra Jha-4096
 
#a=list(map(int,sys.stdin.readline().split(' ')))
#n,k,s= map(int, sys.stdin.readline().split(' '))
 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
n=int(input())
a=list(map(int,sys.stdin.readline().split(' ')))
reach=math.ceil(4.5*n)
s=sum(a)
a.sort()
ans=reach-s
count=0
for aa in a:
    if(ans<=0):
        break
    ans-=(5-aa)
    count+=1
print(count)
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

n = int(input())
g = list(map(int,input().split()))

ans = 0
gr = sum(g)/n

while gr < 4.5:
    ma = min(g)
    i = g.index(ma)
    g[i] = 5
    gr = sum(g)/n
    ans += 1
    

print (ans)
    


n=int(input())
a=list(map(int,input().split(' ')))
s=sum(a)
if s>=n*4.5:
    print(0)
else:
    x=n*4.5-s
    i=0
    a.sort()
    while x>0:
        x-=5-a[i]
        i+=1
    print(i)
        


N = int(input())
*A, = list(map(int, input().split()))
su = sum(A)
if su*2 >= 9*N:
    print(0)
    return

A.sort()
for i in range(N):
    su += 5 - A[i]
    if su*2 >= 9*N:
        print(i+1)
        return
return


n = int(input())
a = [int(x) for x in input().split()]

sum=0
a = sorted(a)
for c in a: sum+=c
avg = sum/n
count = 0
for c in a:
    if avg >= 4.5:
        break
    sum += 5-c
    avg = sum / n
    count += 1
print(count)


n = int(input())
a = list(map(int, input().split()))
less = 0
res = 0
for change in range(2, 6):
	cnt = 0
	cur_sum = 0
	for i in range(n):
		cur_sum += a[i]
	for i in range(n):
		if a[i] == change:
			cnt += 1
	least_want = int(4.5 * n + 0.9)
	if least_want <= cur_sum:
		print(res)
		break
	need = int((least_want - cur_sum + (5 - change) - 1) / (5 - change))
	if need <= cnt:
		print(need + res)
		break
	for i in range(n):
		if a[i] == change:
			a[i] = 5
	res += cnt