#include <bits/stdc++.h>
using namespace std;
template <class T>
bool contain(const std::string &s, const T &v) {
  return s.find(v) != std::string::npos;
}
unsigned long long mod = 1e9 + 7;
int main() {
  int a[5] = {}, v_max = 0, ans = 0;
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
    if (a[i] % 10 == 0) {
      ans += a[i];
    } else {
      ans += a[i] + (10 - a[i] % 10);
      v_max = max(v_max, 10 - a[i] % 10);
    }
    cout << (ans) << endl;
    ;
  }
  cout << ans - v_max << endl;
}
