#include <bits/stdc++.h>
using namespace std;
struct xxx {
  int pt;
};
xxx a[1000];
int n;
void input() {
  int i, j, tong, minn, x;
  tong = 0;
  minn = 200000;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i].pt);
  }
  for (i = 1; i <= n; i++) {
    tong = 0;
    for (j = 1; j <= a[i].pt; j++) {
      scanf("%d", &x);
      tong += x * 5;
    }
    tong += 15 * a[i].pt;
    minn = min(minn, tong);
  }
  printf("%d\n", minn);
}
int main() {
  while (scanf("%d", &n) > 0) {
    input();
  }
  return 0;
}
