#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0, ans = INT_MAX;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    int ld = a[i] * 15;
    while (a[i]--) {
      int x;
      cin >> x;
      sum += (x)*5;
    }
    sum += ld;
    ans = min(sum, ans);
    sum = 0;
  }
  cout << ans;
}
