#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, K[102], m[102] = {0};
  int i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &K[i]);
  int x, sum = 0;
  int maximum = INT_MAX;
  for (i = 0; i < n; i++) {
    sum = 0;
    for (j = 0; j < K[i]; j++) {
      scanf("%d", &x);
      x = x * 5;
      x = x + 15;
      sum += x;
    }
    if (maximum > sum) maximum = sum;
  }
  printf("%d\n", maximum);
  return 0;
}
