#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, a;
  cin >> n;
  long long k[n];
  for (long long i = 0; i < n; i++) {
    cin >> k[i];
  }
  long long mn = 1000000007;
  long long cnt = 0, i = 0;
  while (n--) {
    long long temp = k[i];
    while (k[i]--) {
      cin >> a;
      cnt += a * 5;
    }
    cnt += 15 * temp;
    mn = min(mn, cnt);
    cnt = 0;
    i++;
  }
  cout << mn << '\n';
  return 0;
}
