#include <bits/stdc++.h>
using namespace std;
long long n, ans;
string str;
long long solve() {
  cin >> n;
  ans = INT_MAX;
  long long k[n];
  for (long long i = 0; i <= n - 1; ++i) cin >> k[i];
  for (long long i = 0; i <= n - 1; ++i) {
    long long s = 15 * k[i];
    for (long long j = 0; j <= k[i] - 1; ++j) {
      long long t;
      cin >> t;
      s += t * 5;
    }
    ans = min(ans, s);
  }
  cout << ans;
  return 0;
}
signed main() {
  ios::sync_with_stdio(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
