#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> V(5);
  int sum = 0;
  int min1 = 10;
  for (int i = 0; i < (5); ++i) {
    cin >> V[i];
    V[i] += 9;
    sum += V[i] / 10 * 10;
    cout << sum << endl;
    min1 = min(min1, V[i] % 10);
  }
  cout << sum + min1 - 9 << endl;
}
