A, B = map(int, input().split())
cal = A - B * 2
if cal >= 0:
    print(cal)
else:
    print(0) A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B cal = A - B * 2 cal A - B * 2 A B * 2 B 2 if cal >= 0:
    print(cal)
else:
    print(0) cal >= 0 cal 0 print(cal) print cal print(0) print 0 A, B = map(int, input().split()) map(int, input().split()) A B = map(int, input().split()) map(int, input().split()) B cal = A - B * 2 A - B * 2 cal
A, B = map(int, input().split())
cal = A - B * 2
if cal >= 0:
    print(cal)
else:
    print(0)