#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, a[101], m[101], x = 0, mn;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    x = 0;
    for (j = 1; j <= a[i]; j++) {
      cin >> m[j];
      x = x + m[j];
    }
    x = ((x * 5) + (15 * a[i]));
    if (x < mn) {
      mn = x;
    }
  }
  cout << mn << endl;
  return 0;
}
