#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int k[n];
  for (int i = 0; i < n; i++) cin >> k[i];
  int time[n];
  for (int i = 0; i < n; i++) {
    time[i] = 15 * k[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k[i]; j++) {
      int a;
      cin >> a;
      time[i] += 5 * a;
    }
  }
  int ans = 1e9;
  for (int i = 0; i < n; i++) {
    ans = min(ans, time[i]);
  }
  cout << ans << endl;
  return 0;
}
