#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> k(n, 0);
  for (int i = 0; i < n; ++i) {
    cin >> k[i];
  }
  int ret = numeric_limits<int>::max();
  for (int i = 0; i < n; ++i) {
    int total = 0;
    for (int j = 0; j < k[i]; ++j) {
      int m = 0;
      cin >> m;
      total += m;
    }
    ret = min(ret, total * 5 + k[i] * 15);
  }
  cout << ret << endl;
  return 0;
}
