#include <bits/stdc++.h>
using namespace std;
int main() {
  int cash, i, j, sum = 0, value;
  cin >> cash;
  int que[cash];
  int ara[cash];
  for (i = 0; i < cash; i++) {
    cin >> que[i];
  }
  for (i = 0; i < cash; i++) {
    sum = 0;
    for (j = 0; j < que[i]; j++) {
      cin >> value;
      value = value * 5;
      sum = sum + value;
    }
    sum = sum + (15 * que[i]);
    ara[i] = sum;
  }
  sort(ara, ara + cash);
  cout << ara[0] << endl;
  return 0;
}
