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