#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, a, i, j, p, k, cnt, mh, res, ans = 0, b, c, sum = 0, ar,
                                                   alex, array[100000];
  long long int lfirst, sec, third, mfirst, p2;
  vector<long long int> vec;
  char ch[101][101];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> array[i];
  }
  for (i = 1; i <= n; i++) {
    res = 0;
    for (j = 1; j <= array[i]; j++) {
      cin >> a;
      res = res + a * 5 + 15;
    }
    vec.push_back(res);
  }
  sort(vec.begin(), vec.end());
  cout << vec[0] << endl;
}
