#include <bits/stdc++.h>
int main(void) {
  int a[5], min, t;
  min = 10;
  t = 0;
  for (int i = 0; i < 5; i++) {
    scanf("%d\n", &a[i]);
  }
  for (int i = 0; i < 5; i++) {
    if (a[i] % 10 == 0) {
      t = t + a[i];
      printf("10でわりきれる%d\n", t);
    } else {
      if (min > a[i] % 10) {
        min = a[i] % 10;
        t = t + (a[i] / 10) * 10 + 10;
        printf("minkoushinn%d\n", t);
      } else {
        t = t + (a[i] / 10) * 10 + 10;
        printf("なにもおきない%d\n", t);
      }
    }
  }
  t = t - 10 + min;
  printf("%d\n", t);
  return 0;
}
