#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, f = 0, k;
  cin >> a >> b >> c >> d >> e;
  f += a;
  if (f % 10 != 0) f = (f + 9) / 10 * 10;
  f += b;
  if (f % 10 != 0) f = (f + 9) / 10 * 10;
  f += c;
  if (f % 10 != 0) f = (f + 9) / 10 * 10;
  f += d;
  if (f % 10 != 0) f = (f + 9) / 10 * 10;
  f += e;
  cout << f << endl;
  return 0;
}
