a, b = map(int, raw_input().split()) if(a < b): print(b-2*a) elif(a > b): print(a-2*b) else: print(0)