#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int people_in_queue[n];
  for (int i = 0; i < n; i++) {
    scanf("%d ", &people_in_queue[i]);
  }
  int num_of_product[n][100], sum[n];
  for (int i = 0; i < n; i++) {
    sum[i] = 0;
    for (int j = 0; j < people_in_queue[i]; j++) {
      scanf("%d", &num_of_product[i][j]);
      sum[i] = sum[i] + num_of_product[i][j];
    }
  }
  int time[n];
  for (int i = 0; i < n; i++) {
    time[i] = sum[i] * 5 + people_in_queue[i] * 15;
  }
  int min = time[0];
  for (int i = 0; i < n; i++) {
    if (min > time[i]) {
      min = time[i];
    }
  }
  printf("%d", min);
  return 0;
}
