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*<sub class="lower-index">*i*</sub> people. The *j*-th person standing in the queue to the *i*-th cashier has *m*<sub class="lower-index">*i*, *j*</sub> 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.
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*<sub class="lower-index">1</sub>, *k*<sub class="lower-index">2</sub>, ..., *k*<sub class="lower-index">*n*</sub> (1 ≤ *k*<sub class="lower-index">*i*</sub> ≤ 100), where *k*<sub class="lower-index">*i*</sub> is the number of people in the queue to the *i*-th cashier.

The *i*-th of the next *n* lines contains *k*<sub class="lower-index">*i*</sub> space-separated integers: *m*<sub class="lower-index">*i*, 1</sub>, *m*<sub class="lower-index">*i*, 2</sub>, ..., *m*<sub class="lower-index">*i*, *k*<sub class="lower-index">*i*</sub></sub> (1 ≤ *m*<sub class="lower-index">*i*, *j*</sub> ≤ 100) — the number of products the *j*-th person in the queue for the *i*-th cash has.
#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)

