#include <bits/stdc++.h>
using namespace std;
void io_set() {}
int main() {
  long long int i, n = 5, k, f = 0, j;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int ans = 0, m = INT_MIN;
  for (i = 0; i < n; i++) {
    if (a[i] % 10 == 0) {
      ans += a[i];
    } else {
      f = 1;
      long long int r = a[i] / 10;
      long long int pk = (r + 1) * 10;
      m = max(m, abs(pk - a[i]));
      cout << m << endl;
      ans += pk;
    }
  }
  if (f)
    cout << ans - m << endl;
  else {
    cout << ans << endl;
  }
  return 0;
}
