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