Dima and his friends have been playing hide and seek at Dima's place all night. As a result, Dima's place got messy. In the morning they decided that they need to clean the place.

To decide who exactly would clean the apartment, the friends want to play a counting-out game. First, all the guys stand in a circle, and then each of them shows some number of fingers on one hand (one to five), and then the boys count in a circle, starting from Dima, the number of people, respective to the total number of fingers shown. The person on who the countdown stops will clean the apartment.

For example, if Dima and one of his friends played hide and seek, and 7 fingers were shown during the counting-out, then Dima would clean the place. If there were 2 or say, 8 fingers shown, then his friend would clean the place.

Dima knows how many fingers each of his friends will show during the counting-out. Now he is interested in the number of ways to show some number of fingers on one hand (one to five), so that he did not have to clean the place. Help Dima.


-----Input-----

The first line contains integer n (1 ≤ n ≤ 100) — the number of Dima's friends. Dima himself isn't considered to be his own friend. The second line contains n positive integers, not exceeding 5, representing, how many fingers the Dima's friends will show. 

The numbers in the lines are separated by a single space.


-----Output-----

In a single line print the answer to the problem.


-----Examples-----
Input
1
1

Output
3

Input
1
2

Output
2

Input
2
3 5

Output
3



-----Note-----

In the first sample Dima can show 1, 3 or 5 fingers. If Dima shows 3 fingers, then the counting-out will go like that: Dima, his friend, Dima, his friend.

In the second sample Dima can show 2 or 4 fingers.

Difficulty: interview

Starter code:

Solutions:
n = int(input()) + 1
s = sum(map (int, input().split()))

ans = 5
for i in range (1, 6):
    if (s + i) % n == 1: ans -= 1
print(ans)


n = int(input())
s = sum(map(int, input().split())) % (n + 1)
cnt = sum([1 for i in range(5) if (i + 1 + s) % (n + 1) != 1])
print (cnt)



n=int(input())
s=input().split()
for i in range(n):
    s[i]=int(s[i])
t=sum(s)

ans=5
for i in range(1,6):
    x=t+i
    if(x%(n+1)==1):
        ans-=1
print(ans)


import sys
my_file = sys.stdin
#my_file = open("input.txt", "r")
friends = int(my_file.readline().strip("\n"))+1
fingers = sum([int(i) for i in my_file.readline().split(" ")])
result = 0
for i in range(1,6):
    if (i+fingers)%friends!=1:
        result += 1
print(result)

3

n = int(input())
s = sum(map(int, input().split()))
ans = 0
for i in range(1, 6):
    ans += (s + i) % (n + 1) != 1
print(ans)


n = int(input()) + 1
k = sum(list(map(int, input().split())))
t = [i % n for i in range(k, k + 5)]
print(5 - t.count(0))

n = int(input())
A = list(map(int, input().split()))
Cnt = sum(A)
y = (1 == (((Cnt + 1) % (n + 1))))
y += (1 == (((Cnt + 2) % (n + 1))))
y += (1 == (((Cnt + 3) % (n + 1))))
y += (1 == (((Cnt + 4) % (n + 1))))
y += (1 == (((Cnt + 5) % (n + 1))))
print(5 - y)

n = int(input())+1
a = sum(map(int, input().split()))
c = 0
for i in range(1, 6):
    if (a+i)%n != 1: c += 1

print(c)



f=int(input())
a=sum(list(map(int,input().split())))
r=[1]
for i in range(f):
    r.append(0)
p=5
j=(a%(f+1))-1
for i in range(j,j+5):
    if r[(i+1)%(f+1)]==1:
        p-=1
print(p)

f=int(input())
a=sum(list(map(int,input().split())))
p=5
j=(a%(f+1))-1
for i in range(j,j+5):
    if (i+1)%(f+1)==0:
        p-=1
print(p)

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

x=sum(L)

x%=(n+1)
ans=0
for i in range(1,6):
    if((x+i)%(n+1)!=1):
        ans+=1
print(ans)


def main() -> int:
    n = int(input()) + 1
    fingers = [int(word) for word in input().split()]
    sum_fingers = sum(fingers)
    count = 0

    for i in range(sum_fingers + 1, sum_fingers + 6, 1):
        if i % n == 1:
            count += 1

    result = 5 - count
    print(result)

    return 0


def __starting_point():
    main()
__starting_point()

n = int(input())
s = sum(map(int, input().split()))
ans = 0
for i in range(5):
    ans += 1 if (s + i) % (n + 1) else 0
print(ans)

sa=int(input())
sa2=input().split(' ')
sa3=[int(x) for x in sa2]
sumx=sum(sa3)

t=0
for sa4 in range(1, 6):
    if (sumx+sa4)%(sa+1)!=1:
        t+=1
print(t)


n = int(input()) 
f = list(map(int,input().split()))
t = sum(f)

n += 1
c_pos = t % n
x = 0

for i in range(1,6):
    if (c_pos + i) % n != 1 :
        x += 1
print(x)


n = int(input())
f = sum(int(x) for x in input().split())
print(sum(1 for x in range(1, 6) if (f + x) % (n + 1) != 1))

a=int(input())+1
b=sum(list(map(int,input().split())))
print(len([i for i in [1,2,3,4,5]if(i+b)%a!=1]))


import sys
import math

n = int(sys.stdin.readline())
an = [int(x) for x in (sys.stdin.readline()).split()]

vsum = sum(an)

res = 0
for i in range(1, 6):
    if((i + vsum) % (n + 1) != 1):
        res += 1
        
print(res)

n = int(input())
s = sum(int(x) for x in input().split())
ans = 0
for i in range(5):
	if (s + i) % (n + 1):
		ans += 1
print(ans)


def main():
    n = int(input().strip()) + 1
    x = sum(map(int, input().strip().split())) % n
    return sum((x + i) % n != 1 for i in range(1, 6))


print(main())

'''
Created on Jan 5, 2015

@author: mohamed265
'''
n = int(input())
t = sum([int(x) for x in input().split()])
slon = 0
for i in range(1, 6):
    if (i + t) % (n + 1) != 1:
        slon += 1
print(slon)


a=int(input())
b=input().split()
p=0
for i in range(len(b)):
    p=p+int(b[i])

s=0


for i in range(1,6):
    finger=i

    if(p+i)%(a+1)!=1:
        s=s+1
print(s)

# coding: utf-8
n = int(input())
figers = sum([int(i) for i in input().split()])
ans = 0
for i in range(1,6):
    if (figers+i)%(n+1)!=1:
        ans += 1
print(ans)


n = int(input())

f = input()
a = 0
for i in range(len(f)):
    if f[i] != " ":
        a += int(f[i])

c = 0
for i in range(1,6,1):
    x = a + i -1
    if x%(n+1) != 0:
        c += 1


print(c)

n = int(input())
s = sum(int(x) for x in input().split())
ans = 0
for i in range(5):
    if (s + i) % (n + 1):
        ans += 1
print(ans)