#include <bits/stdc++.h>
using namespace std;
int n, value, a[1000000 + 5];
int cur, ans = 994234923;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cur = 0;
    for (int j = 0; j < a[i]; j++) {
      cin >> value;
      cur += value * 5;
    }
    cur += a[i] * 15;
    ans = min(ans, cur);
  }
  cout << ans << endl;
  return 0;
}
