#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> dish(5);
  vector<int> s(5);
  int ans = 0;
  for (int i = 0; i < 5; i++) {
    cin >> dish.at(i);
    s.at(i) = dish.at(i) % 10;
    dish.at(i) = ((dish.at(i) + 9) / 10) * 10;
    ans += dish.at(i);
  }
  sort(s.begin(), s.end());
  int plus, count = 0;
  for (int i = 0; i < 5; i++) {
    if (s.at(i) == 0) {
      count++;
    }
  }
  plus = s.at(count);
  ans = ans - 10 + plus;
  cout << ans << endl;
}
