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