#include <bits/stdc++.h>
using namespace std;
int A, B, C, D, E;
int main() {
  cin >> A >> B >> C >> D >> E;
  int ans = 0;
  if (A == 10 || 20 || 30 || 40 || 50 || 60 || 70 || 80 || 90 || 100 || 110 ||
      120)
    ans += A;
  else
    ans += A + (120 - A) % 10;
  if (B == 10 || 20 || 30 || 40 || 50 || 60 || 70 || 80 || 90 || 100 || 110 ||
      120)
    ans += B;
  else
    ans += B + (120 - B) % 10;
  if (C == 10 || 20 || 30 || 40 || 50 || 60 || 70 || 80 || 90 || 100 || 110 ||
      120)
    ans += C;
  else
    ans += C + (120 - C) % 10;
  if (D == 10 || 20 || 30 || 40 || 50 || 60 || 70 || 80 || 90 || 100 || 110 ||
      120)
    ans += D;
  else
    ans += D + (120 - D) % 10;
  if (E == 10 || 20 || 30 || 40 || 50 || 60 || 70 || 80 || 90 || 100 || 110 ||
      120)
    ans += E;
  else
    ans += E + (120 - E) % 10;
  cout << ans << endl;
  return 0;
}
