l = sorted(map(int, raw_input().split())) s = l[0] l = map(lambda x:x-s, l) while l[1] != 0: s += 1 l[1] -= 1 l[2] -= 3 l.sort() s += l[2] / 5 print s