while 1:_=map(int,raw_input().split());print~-sum(_)/max(_)/2