#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long c = 100000, sum, k[n];
  for (long long i = 0; i < n; i++) cin >> k[i];
  for (long long i = 0; i < n; i++) {
    sum = 0;
    long long m[k[i]];
    for (long long j = 0; j < k[i]; j++) {
      cin >> m[j];
      sum = 15 + sum + 5 * m[j];
    }
    if (sum < c) c = sum;
  }
  cout << c;
  return 0;
}
