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.
# python 3
"""
Matrix,in which all diagonal elements equal k and other elements equal 0, satisfied all conditions.
"""


def line_to_cashier(n_int: int, k_list: list, m_list: list) -> int:
    time_list = []
    for i_int in range(n_int):
        people_int = k_list[i_int]
        time_int = 0
        for person in range(people_int):
            time_int += m_list[i_int][person] * 5
            time_int += 15
        time_list.append(time_int)

    return min(time_list)


if __name__ == "__main__":
    """
    Inside of this is the test. 
    Outside is the API
    """
    n = int(input())
    k = list(map(int, input().split()))
    m = []
    for i in range(n):
        m.append(list(map(int, input().split())))
    # print(n, k, m)
    print(line_to_cashier(n, k, m))
