#include <bits/stdc++.h>
using namespace std;
double PI = 3.1415926536f;
struct light {
  int index, level;
};
bool sortFunction(light first, light second) {
  return first.level > second.level;
}
int main() {
  int n, i, j, mini = 90000, sum, temp;
  cin >> n;
  int arr[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (i = 0; i < n; i++) {
    sum = 0;
    for (j = 0; j < arr[i]; j++) {
      cin >> temp;
      sum += temp;
    }
    sum *= 5;
    sum += 15 * arr[i];
    mini = min(mini, sum);
  }
  cout << mini;
  return 0;
}
