l,m,n = [int(input()) for _ in '1'*3] print(n%25 + (n//25+m)%4 + ((n//25+m)//4+l)%10)