#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int time = INT_MAX, check = 0;
  for (int i = 0; i < n; i++) {
    check = 0;
    int no = a[i];
    for (int j = 0; j < no; j++) {
      int item;
      cin >> item;
      check += item * 5;
    }
    check += no * 15;
    time = min(time, check);
  }
  cout << time;
}
