#include <bits/stdc++.h>
using namespace std;

int main() {
  int A,B,C,D,E;
  cin >> A>>B>>C>>D>>E;
  int a,b,c,d,e;
  a = A -1;
  b = B -1;
  c = C -1;
  d = D -1;
  e = E - 1;
  a = A % 10;
  b = B % 10;
  c = C % 10;
  d = D % 10;
  e = E % 10;
  cout<< ((A + 9) / 10 + (B + 9)/10 + (C + 9) / 10 + (D + 9) / 10 + (E + 9) / 10)-10+min(a,b,c,d,e);
}
