#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 58;
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
int former(const vector<T> &v, T x) {
  return upper_bound(v.begin(), v.end(), x) - v.begin() - 1;
}
template <class T>
int latter(const vector<T> &v, T x) {
  return lower_bound(v.begin(), v.end(), x) - v.begin();
}
int main() {
  int NUM[5];
  for (int i = 0; i < (5); ++i) {
    cin >> NUM[i];
  }
  int minIndex;
  int min = 10;
  for (int i = 0; i < (5); ++i) {
    float f = NUM[i] % 10;
    if (f == 0) continue;
    if (chmin(min, NUM[i] % 10)) {
      minIndex = i;
    }
  }
  int res = 0;
  for (int i = 0; i < (5); ++i) {
    if (i != minIndex) {
      double tmp = (double)NUM[i] / 10;
      int tmpInt = (int)ceil(tmp);
      NUM[i] = tmpInt * 10;
    }
    cout << NUM[i] << endl;
    res += NUM[i];
  }
  cout << res << endl;
}
