#include <bits/stdc++.h>
using namespace std;
int main() {
  int fcost[105];
  memset(fcost, 0, sizeof(fcost));
  int vec[105];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
    fcost[i] += 15 * vec[i];
  }
  int m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < vec[i]; j++) {
      cin >> m;
      fcost[i] += m * 5;
    }
  }
  sort(fcost, fcost + n);
  cout << fcost[0] << endl;
}
