#include <bits/stdc++.h>
using namespace std;
int main() {
  int min_reminder = 10, accum = 0;
  int a, reminder;
  for (int i = 0; i < 5; i++) {
    cin >> a;
    reminder = a % 10;
    cout << reminder << endl;
    accum += (reminder == 0) ? a : (a / 10 + 1) * 10;
    if (reminder != 0) min_reminder = min(min_reminder, reminder);
  }
  if (min_reminder != 10) accum = accum - 10 + min_reminder;
  cout << accum << endl;
  return 0;
}
