#include <bits/stdc++.h>
using namespace std;
int m[1000];
int ans = (0x3f3f3f3f);
int main(int argc, char const *argv[]) {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d", &m[i]);
  for (int i = 0; i < N; i++) {
    int ans2 = 0, k;
    for (int j = 0; j < m[i]; j++) {
      scanf("%d", &k);
      ans2 += k * 5 + 15;
    }
    ans = min(ans, ans2);
  }
  cout << ans << endl;
  return 0;
}
