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)