#include <bits/stdc++.h>
using namespace std;
int n, k[105], mn = 1e9, ans;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> k[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k[i]; j++) {
      int l;
      cin >> l;
      ans += (l * 5) + 15;
    }
    mn = min(ans, mn);
    ans = 0;
  }
  cout << mn;
  exit(0);
}
