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