#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int time[5];
  int check[5];
  int count = 0;
  int ans = 0;
  for (int i = 0; i < 5; i++) {
    cin >> time[i];
    if (time[i] % 10 == 0)
      ans += time[i];
    else if (time[i] % 10 != 0) {
      check[count] = time[i];
      count++;
    }
  }
  for (int i = 0; i < count - 1; i++) {
    for (int j = i + 1; j < count; j++)
      if (check[i] % 10 < check[j] % 10) swap(check[i], check[j]);
  }
  for (int i = 0; i < count - 1; i++) {
    ans += check[i] + 10 - (check[i] % 10);
    cout << check[i] << endl;
  }
  ans += check[count - 1];
  cout << ans << endl;
  return 0;
}
