#include <bits/stdc++.h>
using namespace std;
int n;
int k[101];
int ans = 2e9;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &k[i]);
  }
  for (int i = 0, a; i < n; i++) {
    int t = 0;
    for (int j = 0; j < k[i]; j++) {
      scanf("%d", &a);
      t += a * 5;
      t += 15;
    }
    ans = min(ans, t);
  }
  printf("%d", ans);
  return 0;
}
