#include <bits/stdc++.h>
using namespace std;
int main() {
  int nofQs;
  cin >> nofQs;
  int minSec = INT_MAX;
  vector<int> custs(nofQs);
  for (int i = 0; i < nofQs; i++) {
    cin >> custs[i];
  }
  for (int i = 0; i < nofQs; i++) {
    int tAmt = 0;
    for (int j = 0; j < custs[i]; j++) {
      int nofItems;
      cin >> nofItems;
      tAmt += (nofItems * 5);
      tAmt += 15;
    }
    minSec = min(tAmt, minSec);
  }
  cout << minSec;
}
