l=list(map(int,input().split())) l.sort() while l[-1]-l[0]>1: l[-1]-=2 l[0]+=1 l.sort() print(min(l))