#include <bits/stdc++.h>
int min(int A, int B, int C, int D, int E, int min) {
  min = A % 10;
  if (min > B % 10) min = B % 10;
  if (min > C % 10) min = C % 10;
  if (min > D % 10) min = D % 10;
  if (min > E % 10) min = E % 10;
  return min;
}
int main() {
  int A, B, C, D, E;
  int min;
  scanf("%d %d %d %d %d", &A, &B, &C, &D, &E);
  printf("%d",
         (((A / 10 + B / 10 + C / 10 + D / 10 + E / 10) + 5) * 10 - 10 + min));
  return 0;
}
