#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, k, temp = 0, ans = 0, flag = false, l, sum = 0, m,
                            mn = 1000000000000000007, mx, count = 0, rest = 0;
  cin >> n;
  vector<long long int> v;
  for (i = 0; i < n; i++) {
    cin >> k;
    v.push_back(k);
  }
  for (i = 0; i < n; i++) {
    temp = v[i] * 15;
    for (j = 0; j < v[i]; j++) {
      cin >> k;
      temp += (k * 5);
    }
    mn = min(mn, temp);
  }
  cout << mn << endl;
  return 0;
}
