Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the products.

There are n cashiers at the exit from the supermarket. At the moment the queue for the i-th cashier already has k_{i} people. The j-th person standing in the queue to the i-th cashier has m_{i}, j items in the basket. Vasya knows that:  the cashier needs 5 seconds to scan one item;  after the cashier scans each item of some customer, he needs 15 seconds to take the customer's money and give him the change. 

Of course, Vasya wants to select a queue so that he can leave the supermarket as soon as possible. Help him write a program that displays the minimum number of seconds after which Vasya can get to one of the cashiers.


-----Input-----

The first line contains integer n (1 ≤ n ≤ 100) — the number of cashes in the shop. The second line contains n space-separated integers: k_1, k_2, ..., k_{n} (1 ≤ k_{i} ≤ 100), where k_{i} is the number of people in the queue to the i-th cashier.

The i-th of the next n lines contains k_{i} space-separated integers: m_{i}, 1, m_{i}, 2, ..., m_{i}, k_{i} (1 ≤ m_{i}, j ≤ 100) — the number of products the j-th person in the queue for the i-th cash has.


-----Output-----

Print a single integer — the minimum number of seconds Vasya needs to get to the cashier.


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

Output
20

Input
4
1 4 3 2
100
1 2 2 3
1 9 1
7 8

Output
100



-----Note-----

In the second test sample, if Vasya goes to the first queue, he gets to the cashier in 100·5 + 15 = 515 seconds. But if he chooses the second queue, he will need 1·5 + 2·5 + 2·5 + 3·5 + 4·15 = 100 seconds. He will need 1·5 + 9·5 + 1·5 + 3·15 = 100 seconds for the third one and 7·5 + 8·5 + 2·15 = 105 seconds for the fourth one. Thus, Vasya gets to the cashier quicker if he chooses the second or the third queue.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
k = map(int, input().split())
times = []
for i in range(n):
    people = list(map(int, input().split()))
    time = len(people) * 15
    for p in people:
        time += p*5
    times.append(time)
print(min(times))

n = int(input())
k = [int(i) for i in input().split()]
m = []
for i in range(n):
    m.append([int(j) for j in input().split()])
t = [0] * n
for i in range(n):
    t[i] = sum(m[i]) * 5 + len(m[i]) * 15
print(min(t))

n=int(input())
k=list(map(int,input().split()))
now=0
m=100000000
for i in range(n):
    b=map(int,input().split())
    now=0
    for j in b:
        now+=j*5+15
    m=min(m,now)
print(m)

kasses = int(input())
sizes = list(map(int, input().split()))
ocheredi = []

for i in range(kasses):
    ocheredi.append(list(map(int, input().split())))

m = -1

for i in ocheredi:
    cm = 15 * len(i)
    for j in i:
        cm += 5*j
    if cm < m or m == -1:
        m = cm

print(m)


n = int(input())
k = list(map(int, input().split()))
r = 51500
for i in range(n):
    m = list(map(int, input().split()))
    p = len(m) * 15 + 5 * sum(m)
    r = min(r, p)
print(r)


n = int(input())
k = list(map(int,input().split()))
m = [0]*n
for i in range(n):
	t = list(map(int,input().split()))
	for j in range(k[i]):
		m[i] += t[j] * 5 + 15
print(min(m))
		


n=int(input())
def read():return list(map(int,input().split()))
k=read()
print( min( sum(read())*5+k[i]*15 for i in range(0,n) ) )


n = int(input())
k = map(int, input().split())
r = 51500
for i in range(n):
    m = list(map(int, input().split()))
    p = len(m) * 15 + 5 * sum(m)
    r = min(r, p)
print(r)

#Filename CF1.py
n = int(input())
size = [int(i) for i in (input().split())]
m = []
for i in range(0,n):
    m.append([])
    m[i] = [int(j) for j in (input().split())] 
ans = [i*15 for i in size]
for i in range(0,n):
    sum=0
    for j in m[i]:
        sum = sum + j*5
    ans[i] = ans[i] + sum
min = ans[0]
for i in ans:
    if i < min:
        min = i
print(min)



n = int(input())

k = list(map(int, input().split()))

#print('k: ', k)

m = []

for i in range(n):
    m.append(list(map(int, input().split())))

#print('m: ', m)

time = []

for i in range(len(k)):
    time.append(0)
    for j in range(len(m[i])):
        time[i] += m[i][j] * 5
        time[i] += 15

#print(time)
print(min(time))

qNumbers = int(input())

k = list(map(int, input().split()))

minScnds = k[0] * 15

itms = list(map(int, input().split()))

for i in range(k[0]):
    minScnds += itms[i] * 5
  
for i in range(1, qNumbers):
    scnds = k[i] * 15
    itms = list(map(int, input().split()))
    for j in range(k[i]):
        scnds += itms[j] * 5
    minScnds = min(scnds, minScnds)

print (minScnds)

n = int(input())
c = list(map(int, input().strip().split()))
ans = 1 << 31
for i in range(n):
    ans = min(ans, sum([int(k) * 5 for k in input().split()]) + c[i] * 15)
print(ans)

n = int(input())
queues = list(map(int, input().split()))
mns = [None] * n
for num in range(n):
    mns[num] = list(map(int, input().split()))
times = [None] * n
for num in range(n):
    time = 0
    for i in range(queues[num]):
        time += mns[num][i] * 5 + 15
    times[num] = time
print(min(times))

kassa = int(input())
people = list(map(int, input().split()))
number = []
for i in range(len(people)):
    number.append(list(map(int, input().split())))
for i in range(len(number)):
    number[i] = sum(number[i]) * 5 + len(number[i]) * 15
print(min(number))

n = int(input())
people = list(map(int, input().split()))
goods = []
for i in range(n):
    goods += [list(map(int, input().split()))]
time = []
for j in range(n):
    time += [people[j] * 15 + sum(goods[j]) * 5]
print(min(time))    

n = int(input())
kassu = list(map(int, input().split()))
products = []
for i in range(n):
   products +=  [list(map(int, input().split()))]
result = []
for i in range(n):
   test_result = 0
   for j in range(kassu[i]):
      test_result += products[i][j] * 5 + 15
   result.append(test_result)
print(min(result))

n = int(input())
our_list_1 = list(map(int, input().split()))
our_list_2 = []
for i in range(n):
    our_list_2.append(sum(list(map(int, input().split()))))
our_sum = our_list_2[0] * 5 + 15 * our_list_1[0]
for i in range(n):
    if (our_list_2[i] * 5 + 15 * our_list_1[i]) < our_sum:
        our_sum = ( our_list_2[i] * 5 + 15 * our_list_1[i])
print(our_sum)    

n = int(input())
m = list(map(int, input().split()))
time = []
products = []
for i in range(len(m)):
    products += [list(map(int, input().split()))]
for i in products:
    time += [15 * len(i) + sum(i) * 5]
print(min(time))
    


def calculator(men, buying):
    result = 0
    result += sum(buying) * 5
    result += men * 15
    return result

def main():
    pay_desks = int(input())
    queue = list(map(int, input().split()))
    temporal = 0
    amount = calculator(queue[0], list(map(int, input().split())))
    for i in range(1, pay_desks):
        temporal = calculator(queue[i], list(map(int, input().split())))
        if temporal < amount:
            amount = temporal
    print(amount)

main()

d, n = 30001, int(input())
t = list(map(int, input().split()))
for i in range(n):
    s = sum(map(int, input().split())) + 3 * t[i]
    if s < d: d = s
print(d * 5)

N = int(input())
kassa = list(map(int, input().split()))
i = 0
people = list([0] * N)
while i != N:
   people[i] = list(map(int, input().split()))
   i += 1
     
min_sec = 100000000000  
for human in people:
   sec = 0
   for tovar in human:
         sec += tovar * 5 + 15
   if min_sec > sec:
         min_sec = sec
           
print(min_sec)


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

sums = []
for i in range(n):
    sums.append(sum([int(x)*5 for x in input().split()]) + 15*peoples[i])

print(min(sums))

n = int(input())
input()
print(min(sum(5 * y + 15 for y in x) for x in (map(int, input().split()) for _ in range(n))))

n=int(input())
k=list(map(int, input().split()))
m=[0]*n
time=[0]*n
for i in range(n):
    m[i]=list(map(int, input().split()))
    time[i]=k[i]*15
    for j in range(len(m[i])):
        time[i]+=m[i][j]*5
print(min(time))


n = int(input())
k = list(map(int, input().split()))
ans = 10 ** 9
for i in range(n):
    m = list(map(int, input().split()))
    ans = min(ans, 15 * len(m) + 5 * sum(m))
print(ans)