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