#include <bits/stdc++.h>
int ceil_10(int order) { return (int)(((double)(order)*0.1)) * 10 + 10; }
int main() {
  int i, j, memory;
  int total = 0;
  int max = 0;
  int ceil_min[5] = {};
  int order[5] = {};
  scanf("%d %d %d %d %d", &order[0], &order[1], &order[2], &order[3],
        &order[4]);
  for (i = 0; i < 5; i++) {
    ceil_min[i] = ceil_10(order[i]);
  }
  for (i = 0; i < 5; i++) {
    if (max < ceil_min[i] - order[i]) {
      max = order[i];
      memory = i;
    }
  }
  for (j = 0; j < 5; j++) {
    if (j == memory) {
      total += order[j];
    } else {
      total += ceil_min[j];
    }
  }
  printf("%d", total);
  return 0;
}
