#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, m, sum = 0;
  vector<double> S;
  vector<int> p;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> k;
    p.push_back(k);
  }
  for (int i = 0; i < p.size(); ++i) {
    for (int j = 0; j < p[i]; ++j) {
      cin >> m;
      sum += m;
    }
    sum = sum * 5 + p[i] * 15;
    S.push_back(sum);
    sum = 0;
  }
  sort(S.begin(), S.end());
  cout << S[0] << endl;
}
