rgb = list(map(int, input().split())) res = min(rgb) rgb = sorted([x - min(rgb) for x in rgb]) while rgb[1] >= 1 and rgb[2] >= 3: res += 1 rgb[1] -= 1 rgb[2] -= 3 if rgb[1] > rgb[2]: rgb[1], rgb[2] = rgb[2], rgb[1] res += rgb[2] // 5 print(res)