#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, A, B, C, D, E, x;
  cin >> a >> b >> c >> d >> e;
  A = a % 10;
  B = b % 10;
  C = c % 10;
  D = d % 10;
  E = e % 10;
  if (A == 0) {
    A += 10;
  }
  if (B == 0) {
    B += 10;
  }
  if (C == 0) {
    C += 10;
  }
  if (D == 0) {
    D += 10;
  }
  if (E == 0) {
    E += 10;
  }
  x = min(A, (B, (C, (D, E))));
  cout << ((a + 9) / 10) * 10 + ((b + 9) / 10) * 10 + ((c + 9) / 10) * 10 +
              ((d + 9) / 10) * 10 + ((e + 9) / 10) * 10 + x - 10
       << endl;
}
