#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cash[100], item[100][100], sum[100] = {0}, t[100] = {0};
  cin >> n;
  for (int i = 0; i < n; i++) cin >> cash[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < cash[i]; j++) {
      cin >> item[i][j];
      sum[i] += item[i][j];
    }
  }
  int min = INT_MAX;
  for (int i = 0; i < n; i++) {
    if (sum[i] * 5 + cash[i] * 15 < min) {
      min = sum[i] * 5 + cash[i] * 15;
    }
  }
  cout << min;
  return 0;
}
