#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, *k, t, x, min = 10000000;
  cin >> n;
  k = new int[n];
  for (int i = 0; i < n; i++) cin >> k[i];
  for (int i = 0; i < n; i++) {
    t = 0;
    for (int j = 0; j < k[i]; j++) {
      cin >> x;
      t += (x * 5) + 15;
    }
    if (t < min) min = t;
  }
  cout << min;
}
