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