#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  a = (a + 10 - 1) / 10 * 10;
  b = (b + 10 - 1) / 10 * 10;
  c = (c + 10 - 1) / 10 * 10;
  d = (d + 10 - 1) / 10 * 10;
  e = (e + 10 - 1) / 10 * 10;
  cout << a + b + c + d + e;
  return 0;
}
