#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<int> v;
  cin >> n;
  v.resize(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int Min = 1000 * 1000 * 1000;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < v[i]; j++) {
      cin >> m;
      sum += 5 * m + 15;
    }
    if (sum < Min) Min = sum;
  }
  cout << Min;
}
