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