#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  int a[1000], b[1000];
  int cnt = 0, sum = 0, sum2 = 0, mini = 100000000;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < a[i]; j++) {
      cin >> b[j];
      cnt++;
      sum2 += b[j] * 5;
    }
    sum2 += cnt * 15;
    if (sum2 < mini) {
      mini = sum2;
    }
    sum2 = 0;
    cnt = 0;
  }
  cout << mini;
  return 0;
}
