#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long int min = 2147483640;
  int *a = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < a[i]; j++) {
      int temp;
      cin >> temp;
      sum = sum + temp * 5;
      sum += 15;
    }
    if (sum < min) min = sum;
  }
  cout << min;
  return 0;
}
