#include <bits/stdc++.h>
using namespace std;
const int M = 100 + 10;
int n, Min = 100000000000;
struct Casher {
  int peo;
  int item[M];
} a[M];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i].peo);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= a[i].peo; ++j) scanf("%d", &a[i].item[j]);
  for (int i = 1; i <= n; ++i) {
    int t = 0;
    for (int j = 1; j <= a[i].peo; ++j) t += a[i].item[j] * 5;
    t += a[i].peo * 15;
    if (t < Min) Min = t;
  }
  cout << Min << endl;
  return 0;
}
