#include <bits/stdc++.h>
using namespace std;
int n, x, mn = 1e9, q;
int k[100];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> k[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k[i]; j++) {
      cin >> x;
      q += x * 5;
    }
    q += k[i] * 15;
    mn = min(q, mn);
    q = 0;
  }
  cout << mn << endl;
}
