#include <bits/stdc++.h>
using namespace std;
int sumr[101];
int main() {
  int n;
  cin >> n;
  int k[n];
  for (int i = 0; i < n; i++) {
    cin >> k[i];
  }
  int m[n][101];
  int mine = 0, ind = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k[i]; j++) {
      cin >> m[i][j];
      sumr[i] += m[i][j];
    }
    sumr[i] = (sumr[i] * 5) + (k[i] * 15);
    if (sumr[i] <= sumr[ind]) {
      ind = i;
    }
  }
  cout << sumr[ind];
  return 0;
}
