#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
const long long mod = 1e9 + 7;
const long long inf = -1e18;
const long long INF = 1e18;
long long n, a[N], cnt, x, mn = INF, ans = 1;
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= a[i]; j++) {
      cin >> x;
      cnt += x * 5;
    }
    cnt += a[i] * 15;
    if (mn > cnt) {
      mn = cnt;
    }
    cnt = 0;
  }
  cout << mn;
}
int main() {
  solve();
  return 0;
}
