#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p = 1000000000;
  cin >> n;
  int k[n], i;
  for (i = 0; i < n; i++) {
    cin >> k[i];
  }
  i = 0;
  int j = 0, sum = 0;
  while (n--) {
    sum = 0;
    while (k[i]--) {
      cin >> j;
      sum = sum + j * 5 + 15;
    }
    i++;
    if (sum < p) {
      p = sum;
    }
  }
  cout << p;
  return 0;
}
