V = list(map(int, input().split())) ans = 1 << 30 for a in range(1, 31): for b in range(1, 31): for c in range(1, 31): dp = [1 << 30] * 31 dp[0] = 0 for x in [a, b, c]: for i in range(x, 31): dp[i] = min(dp[i], dp[i - x] + 1) tot = 0 for v in V: tot += dp[v] ans = min(ans, tot) print(ans)