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