#include <bits/stdc++.h>
#pragma comment(linker, "/Stack:256000000")
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<long long> a(n + 1);
  vector<long long> k(n + 1);
  for (int i = 0; i < n; ++i) {
    cin >> k[i];
    a[i] = 0;
  }
  long long tmp;
  for (int i = 0; i < n; ++i) {
    for (int j = 1; j <= k[i]; ++j) {
      cin >> tmp;
      a[i] += tmp * 5;
    }
    a[i] += k[i] * 15;
  }
  long long ans = a[0];
  for (int i = 0; i < n; ++i) {
    ans = min(ans, a[i]);
  }
  cout << ans;
  return 0;
}
