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