#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  scanf("%d ", &n);
  int r = 0x7FFFFFFF;
  vector<int> sz(n);
  for (int i = 0; i < (int)(n); i++) scanf("%d ", &sz[i]);
  for (int i = 0; i < (int)(n); i++) {
    int s = 0;
    for (int j = 0; j < (int)(sz[i]); j++) {
      int a;
      scanf("%d ", &a);
      s += 5 * a;
    }
    s += 15 * sz[i];
    r = min(r, s);
  }
  printf("%d\n", r);
}
int main() {
  solve();
  return 0;
}
