#include <bits/stdc++.h>
using namespace std;
int ans = 10000000;
int main() {
  int n;
  int k[200];
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &k[i]);
    int j = 1;
    while (j <= n) {
      int i;
      int m;
      int sum = 0;
      for (i = 1; i <= k[j]; i++) {
        scanf("%d", &m);
        sum += m;
      }
      sum = sum * 5 + k[j] * 15;
      if (sum < ans) ans = sum;
      j++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
