#include <bits/stdc++.h>
using namespace std;
int main() {
  int g, a[101], f, b[101] = {0}, s;
  cin >> g;
  for (int i = 0; i < g; i++) cin >> a[i];
  for (int i = 0; i < g; i++) {
    for (int j = 0; j < a[i]; j++) {
      cin >> f;
      b[i] += f * 5 + 15;
    }
  }
  sort(b, b + g);
  cout << b[0];
  return 0;
}
