a, b = map(int, input().split())

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

if a <= b:
    print(0)
elif a - 2*b <= 0:
    print(0)
elif a - 2*b > 0:
    print(a - 2 * b)