import sequtils,strutils,algorithm,math var S = stdin.readline.split.map(parseInt) S.sort(cmp) var ans = $(sum(S[1..4]) / 4) if sum(S[1..4]) mod 2 == 0: ans &= "0" echo ans