#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vii = vector<int>;
using vll = vector<ll>;
template <class T>
using vv = vector<T>;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
void show(const vector<T> &a) {
  for (int i = 0; i < (int)a.size(); ++i)
    cout << a[i] << (i != (int)a.size() - 1 ? " " : "\n");
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
int dy[] = {0, 1, -1, 0};
int dx[] = {1, 0, 0, -1};
int n, k[110], m[110][110];
int sum[110];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < (n); ++i) cin >> k[i];
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (k[i]); ++j) cin >> m[i][j];
  }
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (k[i]); ++j) {
      sum[i] += m[i][j] * 5;
    }
    sum[i] += k[i] * 15;
  }
  int ans = 2001001001;
  for (int i = 0; i < (n); ++i) {
    if (sum[i] != 0) ans = min(ans, sum[i]);
  }
  cout << ans << endl;
  return 0;
}
