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] const INF = 1e6.int var ans = INF # 30 * 30 * 30 for A in 1..V.max(): for B in 1..A: for C in 1..B: var dp = newSeqWith(V.max()+1,INF) # v を ABC で 作るのに掛かるコストの最小値 dp[0] = 0 for v in 0..V.max()-A: if dp[v] != INF: dp[v + A] .min= dp[v] + 1 for v in 0..V.max()-B: if dp[v] != INF: dp[v + B] .min= dp[v] + 1 for v in 0..V.max()-C: if dp[v] != INF: dp[v + C] .min= dp[v] + 1 ans .min= V.mapIt(dp[it]).sum() echo ans