#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, min = 10000000, m, sum = 0, k;
  cin >> n;
  int a[n], i;
  for (i = 0; i < n; i++) cin >> a[i];
  i = 0;
  while (n--) {
    sum = 0;
    k = a[i];
    while (k--) {
      cin >> m;
      sum = sum + m * 5;
    }
    sum = sum + a[i] * 15;
    if (min >= sum) min = sum;
    i++;
  }
  cout << min << endl;
}
