x,y=map(int,input().split()) diff=max(x,y)-min(x,y) if 0<=max(x,y)+diff<12: print(max(x,y)+diff) elif 0<=min(x,y)-diff<12: print(min(x,y)-diff) else: print((x+y)//2)