#include <bits/stdc++.h>
using namespace std;
const int Max = 10055;
int gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
int main() {
  long long mn = 10000000000, n, y, sum = 0;
  cin >> n;
  int x[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < x[i]; j++) {
      cin >> y;
      sum += (5 * y);
    }
    sum += (x[i] * 15);
    mn = min(sum, mn);
    sum = 0;
  }
  cout << mn;
  return 0;
}
