#include <bits/stdc++.h>
int main(void) {
  int a, b, c, d, e, A, B, C, D, E, ans;
  scanf("%d\n", &a);
  scanf("%d\n", &b);
  scanf("%d\n", &c);
  scanf("%d\n", &d);
  scanf("%d\n", &e);
  A = a + 10 - a % 10;
  B = b + 10 - b % 10;
  C = c + 10 - c % 10;
  D = d + 10 - d % 10;
  E = e + 10 - e % 10;
  ans = A + B + C + D + E;
  printf("%d", ans);
  return 0;
}
