#include <bits/stdc++.h>
int main() {
  float a, b, c, d, e;
  scanf("%f %f %f %f %f", &a, &b, &c, &d, &e);
  printf("%d", int(a / 10 + 0.5) * 10 + int(b / 10 + 0.5) * 10 +
                   int(c / 10 + 0.5) * 10 + int(d / 10 + 0.5) * 10 +
                   int(d / 10 + 0.5) * 10 + int(e / 10 + 0.5) * 10);
  return 0;
}
