#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  vector<int> a(5);
  for (int i = 0; i < (5); ++i) cin >> a[i];
  sort(a.begin(), a.end());
  int ans = 0;
  for (int i = 0; i < (4); ++i) {
    int tmp = (a[i] + 9) / 10;
    tmp *= 10;
    ans += tmp;
  }
  ans += a[3];
  cout << ans << endl;
  return 0;
}
