#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[5];
  int ans = 0;
  for (int i = 0; i < 5; i++) {
    cin >> x[i];
    if (x[i] % 10 == 0) {
      ans += x[i];
    } else {
      ans += x[i] + 10 - x[i] % 10;
    }
  }
  cout << ans << endl;
  return 0;
}
