#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> sum;
  int br[n];
  for (int i = 0; i < n; i++) {
    cin >> br[i];
  }
  for (int i = 0; i < n; i++) {
    int arr[br[i]], sum1 = 0;
    for (int j = 0; j < br[i]; j++) {
      cin >> arr[i];
      sum1 += arr[i] * 5;
    }
    sum1 += br[i] * 15;
    sum.push_back(sum1);
  }
  cout << *min_element(sum.begin(), sum.end()) << endl;
}
