#include <bits/stdc++.h>
using namespace std;
int n;
int num[105];
int que[105][105];
int main() {
  scanf("%d", &n);
  int i, j;
  int min = 1000000000;
  for (i = 1; i <= n; i++) scanf("%d", &num[i]);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= num[i]; j++) scanf("%d", &que[i][j]);
    int sum = 0;
    for (j = 1; j <= num[i]; j++) sum += que[i][j] * 5;
    sum += num[i] * 15;
    if (sum < min) min = sum;
  }
  printf("%d\n", min);
  return 0;
}
