#include <bits/stdc++.h>
int main(void) {
  int Dish, Dish1, Dish2, Dish3, Dish4, Dish5;
  int dish[5];
  scanf("%d\n%d\n%d\n%d\n%d", &dish[0], &dish[1], &dish[2], &dish[3], &dish[4]);
  for (int i = 0; i < 5; ++i) {
    for (int j = i + 1; j < 5; ++j) {
      if (dish[i] > dish[j]) {
        Dish = dish[i];
        dish[i] = dish[j];
        dish[j] = Dish;
      }
    }
  }
  Dish1 = (dish[0] / 10 + 1) * 10;
  Dish2 = (dish[1] / 10 + 1) * 10;
  Dish3 = (dish[2] / 10 + 1) * 10;
  Dish4 = (dish[3] / 10 + 1) * 10;
  Dish5 = (dish[4] / 10 + 1) * 10;
  int dishtime = Dish1 + Dish2 + Dish3 + Dish4;
  printf("%d\n", dishtime);
  return 0;
}
