#include <bits/stdc++.h>
using namespace std;
int main() {
  short n, temp;
  int a = INT_MAX;
  cin >> n;
  vector<short> v;
  while (n--) {
    cin >> temp;
    v.push_back(temp);
  }
  for (auto it = v.begin(); it != v.end(); ++it) {
    int thisSum = 0;
    for (short j = 0; j < *it; ++j) {
      cin >> temp;
      thisSum += (5 * temp) + 15;
    }
    if (thisSum < a) a = thisSum;
  }
  cout << a;
  return 0;
}
