import sequtils,strutils,algorithm,math,future,macros template get*():string = stdin.readLine().strip() template `min=`*(x,y:typed):void = x = min(x,y) let V = get().split().map(parseInt).sorted(cmp) # 4 * [1,30] vmax = V.max() const INF = 1e6.int var ans = INF # 30 * 30 * 30 for A in 1..vmax: for B in 1..A: for C in 1..B: var dp = newSeqWith(vmax+1,INF) # v を ABC で 作るのに掛かるコストの最小値 dp[0] = 0 for v in 0..vmax-A: if dp[v] != INF: dp[v + A] .min= dp[v] + 1 for v in 0..vmax-B: if dp[v] != INF: dp[v + B] .min= dp[v] + 1 for v in 0..vmax-C: if dp[v] != INF: dp[v + C] .min= dp[v] + 1 ans .min= V.mapIt(dp[it]).sum() echo ans