#include <bits/stdc++.h>
int main(void) {
  int x[5], S = 0;
  for (int i = 0; i < 5; i++) {
    scanf("%d", &x[i]);
  }
  for (int i = 0; i < 5; i++) {
    x[i] /= 10;
    x[i] += 1;
    x[i] *= 10;
    S += x[i];
  }
  printf("%d\n", S);
  return 0;
}
