l = int(raw_input()) m = int(raw_input()) n = int(raw_input()) while 25 <= n: n-=25 m+-1 while 4 <= m: m-=4 l+=1 while 10 <= l: l-=10 print l+m+n