#include <bits/stdc++.h>
using namespace std;
int a[111];
int main() {
  int i, n, t, x;
  int themax = 1000000007;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    t = 0;
    while (a[i]--) {
      cin >> x;
      t += 15;
      t += x * 5;
    }
    themax = min(themax, t);
  }
  cout << themax << endl;
  return 0;
}
