v=list(map(int, input().split())) m=max(v) INF=1000 ans=INF import itertools for a, b, c in itertools.combinations(range(1, m+1), 3): dp=[INF]*(m+1) dp[0]=0 for i in range(1, m+1): for x in [a, b, c]: if i>=x: dp[i]=min(dp[i], dp[i-x]+1) ans=min(ans, sum(dp[x] for x in v)) print(ans)