#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cashier[n], items, time[n];
  for (int i = 0; i < n; i++) {
    cin >> cashier[i];
    time[i] = cashier[i] * 15;
  }
  for (int j = 0; j < n; j++) {
    for (int k = 0; k < cashier[j]; k++) {
      cin >> items;
      time[j] += items * 5;
    }
  }
  sort(time, time + n);
  cout << time[0];
  return 0;
}
