#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
const long double EPS = 1e-12;
const int MAXN = (int)1e5;
const int INF = (int)2e9;
int main() {
  int n, a[100];
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  int ans = INF;
  for (int i = 0; i < n; ++i) {
    int sum = 0;
    for (int j = 0; j < a[i]; ++j) {
      int num;
      scanf("%d", &num);
      sum += num * 5 + 15;
    }
    ans = min(ans, sum);
  }
  printf("%d", ans);
  return 0;
}
