#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, ans = 100000000;
  cin >> a;
  int y[a];
  for (int i = 0; i < a; i++) {
    int h;
    cin >> h;
    y[i] = h;
  }
  for (int i = 0; i < a; i++) {
    int sum = 0;
    for (int j = 0; j < y[i]; j++) {
      int b;
      cin >> b;
      sum = sum + b * 5 + 15;
    }
    ans = min(ans, sum);
  }
  cout << ans;
  return 0;
}
