#include <bits/stdc++.h>
using namespace std;
int n, a[112], ans = 1e9;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    int r = 0;
    for (int j = 0, t; j < a[i]; ++j) {
      cin >> t;
      r += t * 5;
    }
    r += a[i] * 15;
    ans = min(ans, r);
  }
  cout << ans;
}
