#include <bits/stdc++.h>
using namespace std;
int k[150];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> k[i];
  int mn = 1000100;
  for (int i = 0; i < n; ++i) {
    int temp = 0;
    for (int j = 0, v; j < k[i]; j++) {
      cin >> v;
      temp += v * 5 + 15;
    }
    mn = min(mn, temp);
  }
  cout << mn << endl;
  return 0;
}
