#include <bits/stdc++.h>
using namespace std;
int solve() {
  int n;
  cin >> n;
  int k[n];
  for (int i = 0; i < n; i++) {
    cin >> k[i];
  }
  int mn = 0;
  for (int i = 0; i < n; i++) {
    int s = 0, t;
    for (int j = 0; j < k[i]; j++) {
      cin >> t;
      s += 5 * t + 15;
    }
    if (!i)
      mn = s;
    else if (mn > s)
      mn = s;
  }
  cout << mn << "\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
