main = do [a,b,c]<-getContents>>=return.map(read::String->Integer).lines print$sum[c`mod`25,(b+c`div`25)`mod`4,(a+(b+c`div`25)`div`4)`mod`10]