#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> B;
  vector<int> A;
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int b;
  cin >> b;
  for (int i = 0; i < b; i++) {
    int m;
    cin >> m;
    A.push_back(m);
  }
  for (int i = 0; i < A.size(); i++) {
    int sum = 0;
    for (int j = 0; j < A[i]; j++) {
      int f;
      cin >> f;
      sum = sum + f;
    }
    B.push_back(A[i]);
    A[i] = sum;
  }
  int m = A[0] * 5 + B[0] * 15;
  for (int f = 0; f < A.size(); f++) {
    if (m > (A[f] * 5 + B[f] * 15)) {
      m = A[f] * 5 + B[f] * 15;
    }
  }
  cout << m;
}
