
    vector<int> nexttime(n);
    rep(i, n) {
        nexttime[i] = (abc[i] + 9) / 10 * 10;
    }
    int besttime = 999999;
    rep(i, n) {
        int sumtime = 0;
        for (int j; j < n; j++) {
            if (i == j) sumtime += abc[i];
            else {
                sumtime += nexttime[i];
            }
        }
        besttime = min(besttime, sumtime);

    }
    cout << besttime << endl;

}
   