a,b=[int(i) for i in input().split()] c,d=[int(i) for i in input().split()] if (a<0) and (b<0) and (c<0) and (d<0): print((a+b+c+d)*-1/2) elif (a<0) or (c<0): print(((a+c)*-1+(b+d))/2) elif (b<0) or (d<0): print(((b+d)*-1+(a+c))/2)