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

int main(){
  vector<double> d(5);
  int ans = 0;
  int minm = 100;
  for(int i=0;i<5;i++){
    cin>>d.at(i);
    ans += ceil(d.at(i)/10)*10;
    if(d.at(i)%10 == 0){
      continue;
    }
    minm = min(minm,d.at(i)%10);
  }
  ans -= 10-minm;
  cout<<ans<<endl;
}