#include <bits/stdc++.h>
using namespace std;
int s[10000], d[100000];
int main() {
  int a, c, f, n = 9999999;
  cin >> a;
  for (int i = 1; i <= a; i++) {
    cin >> s[i];
  }
  for (int i = 1; i <= a; i++) {
    f = 0;
    for (int j = 1; j <= s[i]; j++) {
      cin >> c;
      f += c * 5;
    }
    f += s[i] * 15;
    d[i] = f;
    f = 0;
  }
  for (int i = 1; i <= a; i++) {
    if (n > d[i]) n = d[i];
  }
  cout << n << endl;
  return 0;
}
