#include <bits/stdc++.h>
using namespace std;
int f(int x) {
  return ((x - 1) / 10 + 1) * 10;
}
int main() {
  int A, B, C, D, E;
  cin >> A >> B >> C >> D >> E;
  cout << f(A) + f(B) + f(C) + f(D) + f(E); << endl;
}