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