#include <bits/stdc++.h>
using namespace ::std;
int main() {
  int n;
  cin >> n;
  int *my_array;
  my_array = new int[n];
  for (int i = 0; i < n; i++) cin >> my_array[i];
  int **my_array2;
  my_array2 = new int *[n];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < my_array[i]; j++) {
      my_array2[i] = new int[my_array[i]];
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < my_array[i]; j++) cin >> my_array2[i][j];
  int sum = 0;
  int *my_array3;
  my_array3 = new int[n];
  for (int i = 0; i < n; i++) {
    sum = 0;
    for (int j = 0; j < my_array[i]; j++) sum += my_array2[i][j];
    my_array3[i] = (sum * 5) + (my_array[i] * 15);
    sum = 0;
  }
  int min = my_array3[0];
  for (int i = 0; i < n; i++)
    if (my_array3[i] < min) {
      swap(min, my_array3[i]);
    }
  cout << min;
  delete my_array;
  delete my_array3;
  for (int i = 0; i < n; i++) delete[] my_array2[i];
  delete[] my_array2;
  return 0;
}
