#include <bits/stdc++.h>
int main() {
  int a, b, c, d, e, time;
  scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
  time = (a + 9) / 10 * 10 + (b + 9) / 10 * 10 + (c + 9) / 10 * 10 +
         (d + 9) / 10 * 10 + (e + 9) / 10 * 10;
  printf("%d\n", time);
  return 0;
}
