#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n], s[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  int i = 0;
  int b[102], max = 10000000;
  while (n--) {
    int sum = 0;
    for (int k = 0; k < a[i]; k++) {
      scanf("%d", b + k);
      sum += (b[k] * 5) + 15;
    }
    if (max > sum) max = sum;
    i++;
  }
  printf("%d\n", max);
  return 0;
}
