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