import sys

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

A, B = map(int, input().split())
print(max(0, A - B * 2))

 import sys sys sys.setrecursionlimit(100000000) sys.setrecursionlimit sys setrecursionlimit 100000000 input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B print(max(0, A - B * 2)) print max(0, A - B * 2) max 0 A - B * 2 A B * 2 B 2 A, B = map(int, input().split()) map(int, input().split()) A input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input B = map(int, input().split()) map(int, input().split()) B
import sys

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

A, B = map(int, input().split())
print(max(0, A - B * 2))


