#include <bits/stdc++.h>
using namespace std;
int k[110];
int m[110][110];
int ans[110];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &k[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k[i]; j++) {
      scanf("%d", &m[i][j]);
      ans[i] += m[i][j] * 5;
    }
    ans[i] += k[i] * 15;
  }
  sort(ans, ans + n);
  cout << ans[0];
}
