for i in $(seq 5); do read a[$i];done
sum=0
res=10
for i in $(seq 5); do $((sum += ((a[i]-1)/10 +1)*10))>/dev/nul;x=a[$i]%10; $(( res=(x !=0 && x<res)? x:res)) >/dev/nul; done 
echo $((sum -10 + res))
