#include <bits/stdc++.h>
using namespace std;
int q[110];
int main(void) {
  int n;
  cin >> n;
  int i, j;
  for (i = 1; i <= n; i++) cin >> q[i];
  int ans = 100000;
  for (i = 1; i <= n; i++) {
    int x, c = 0;
    for (j = 1; j <= q[i]; j++) {
      cin >> x;
      c += x * 5 + 15;
    }
    ans = min(ans, c);
  }
  cout << ans << endl;
  return 0;
}
