#include <bits/stdc++.h>
int main() {
  int nc, i, j, min = INFINITY, total = 0, temp, arr[105];
  scanf("%d", &nc);
  for (i = 0; i < nc; i++) {
    scanf("%d", &arr[i]);
  }
  for (i = 0; i < nc; i++) {
    for (j = 0; j < arr[i]; j++) {
      scanf("%d", &temp);
      total += temp;
    }
    total *= 5;
    total += 15 * arr[i];
    if (total < min) {
      min = total;
    }
    total = 0;
  }
  printf("%d", min);
  return 0;
}
