def solve():
    N, M = map(int, input().split())
    return N - M*2 if N //2 >= M else 0

print(solve()) def solve():
    N, M = map(int, input().split())
    return N - M*2 if N //2 >= M else 0 solve N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M return N - M*2 if N //2 >= M else 0 N - M*2 if N //2 >= M else 0 N //2 >= M N //2 N 2 M N - M*2 N M*2 M 2 0 print(solve()) print solve() solve def solve():
    N, M = map(int, input().split())
    return N - M*2 if N //2 >= M else 0 def solve():
    N, M = map(int, input().split())
    return N - M*2 if N //2 >= M else 0 solve
def solve():
    N, M = map(int, input().split())
    return N - M*2 if N //2 >= M else 0

print(solve())
