#include <bits/stdc++.h>
using namespace std;
int mpow(int base, int exp);
void ipgraph(int m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
void solve() {
  int val = INT_MAX;
  int n;
  cin >> n;
  int arr[101];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    int values = 0;
    for (int j = 0; j < arr[i]; j++) {
      int a;
      cin >> a;
      values += a * 5;
    }
    values += 15 * arr[i];
    val = min(values, val);
  }
  cout << val << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}
