#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n;
  std::cin >> n;
  long long int ans[n];
  for (long long int i = 0; i < n; i++) {
    std::cin >> ans[i];
  }
  long long int count[n];
  memset(count, 0, sizeof(count));
  for (long long int i = 0; i < n; i++) {
    count[i] += (ans[i] * 15);
    for (long long int j = 0; j < ans[i]; j++) {
      long long int x;
      std::cin >> x;
      count[i] += (x * 5);
    }
  }
  long long int min = (*(std::min_element(count, count + n)));
  std::cout << min << "\n";
  return 0;
}
