#include <bits/stdc++.h>
using namespace std;
string tos(int ias) {
  stringstream out;
  out << ias;
  return out.str();
}
int toi(string sai) {
  istringstream in(sai);
  int ans;
  in >> ans;
  return ans;
}
int main() {
  int N, a, b, mini;
  while (cin >> N) {
    int K[N];
    mini = 100000;
    for (int i = 0; i < N; i++) cin >> K[i];
    for (int i = 0; i < N; i++) {
      a = K[i] * 15;
      for (int j = 0; j < K[i]; j++) {
        cin >> b;
        a += b * 5;
      }
      mini = min(mini, a);
    }
    cout << mini << endl;
  }
}
