L = int( input()) M = int( input()) N = int( input()) T = L*100+M*25+N L = T//100%10 M = T//25%4 N = T%25 print(L+M+N)