#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  ;
  int n, lab;
  long long min = 1000000000, sum = 0;
  cin >> n;
  int k[n];
  for (int i = 0; i < n; i++) cin >> k[i];
  for (int i = 0; i < n; i++) {
    sum = 0;
    for (int j = 0; j < k[i]; j++) {
      cin >> lab;
      sum += lab * 5 + 15;
    }
    if (min > sum) min = sum;
  }
  cout << min;
}
