#include <bits/stdc++.h>
using namespace std;
int roundup(int a) {
  int result = (a - a % 10 + (10 - a % 10));
  return result;
}
int main() {
  int A, B, C, D, E;
  cin >> A;
  cin >> B;
  cin >> C;
  cin >> D;
  cin >> E;
  int result = roundup(A) + roundup(B) + roundup(C) + round(D) + roundup(E);
  return result;
}
