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