#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int k[110];
  for (int i = 0; i < n; i++) {
    cin >> k[i];
  }
  int m[110][110];
  int mn = 0;
  bool f = true;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < k[i]; j++) {
      cin >> m[i][j];
      sum += m[i][j] * 5;
      sum += 15;
    }
    if (!f)
      mn = min(mn, sum);
    else {
      mn = sum;
      f = false;
    }
  }
  cout << mn << endl;
}
