#include <bits/stdc++.h>
using namespace std;
int abs(int x) { return x < 0 ? -x : x; }
int main() {
  int n, i, j, min = 0, sum, k;
  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 >> k;
      sum += k * 5 + 15;
    }
    if (i == 0)
      min = sum;
    else if (min > sum) {
      min = sum;
    }
  }
  cout << min;
  return 0;
}
