while 1:print"%.f"%eval("(%s+%s+%s-2*%s)**.5*"*4%tuple(5*raw_input().split()+[0])+"1/4")