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