#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, mn = 1e9, k, res = 0, a;
  vector<int> v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> k;
    v.push_back(k);
  }
  for (int i = 0; i < v.size(); i++) {
    res = 0;
    int x = v[i];
    for (int j = 0; j < x; j++) {
      cin >> a;
      res += (a * 5) + 15;
    }
    mn = min(mn, res);
  }
  cout << mn << endl;
  return 0;
}
