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