#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int numOfCashiers;
  cin >> numOfCashiers;
  string line;
  getline(cin, line);
  getline(cin, line);
  int minSeconds = INT32_MAX;
  for (int c = 0; c < (int)(numOfCashiers); c++) {
    string items;
    getline(cin, items);
    stringstream stream(items);
    string item;
    int total = 0;
    while (stream >> item) {
      int numOfItems = atoi(item.c_str());
      total += numOfItems * 5 + 15;
    }
    if (minSeconds > total) {
      minSeconds = total;
    }
  }
  cout << minSeconds;
  return 0;
}
