#include <bits/stdc++.h>
using namespace std;
int main() {
  int A[5];
  double a[5];
  int timememo;
  int minRemainder = 10;
  int imemo;
  int i;
  for (int i = 0; i < 5; i++) {
    cin >> A[i];
    a[i] = ceil(A[i] / 100) * 10;
    timememo = A[i] % 10;
    if (timememo == 0) {
      timememo = 10;
    }
    if (timememo < minRemainder) {
      minRemainder = timememo;
      imemo = i;
    }
  }
  for (int i = 0; i < 5; i++) {
  }
  int ordertime;
  for (int i = 0; i < 5; i++) {
    ordertime += a[i];
  }
  ordertime = ordertime - a[imemo] + A[imemo];
  cout << ordertime << endl;
  return 0;
}
