#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, i, n, b[102], temp = 0, tpos, pos, min1 = INT_MAX, j, c;
  cin >> a;
  for (i = 0; i < a; i++) {
    cin >> b[i];
  }
  for (i = 0; i < a; i++) {
    for (j = 0; j < b[i]; j++) {
      cin >> c;
      temp += c;
      tpos = b[i];
    }
    temp = temp * 5 + (tpos * 15);
    if (temp < min1) {
      min1 = temp;
      temp = 0;
      pos = tpos;
    } else
      temp = 0;
  }
  cout << min1 << endl;
  return 0;
}
