# 問題：https://atcoder.jp/contests/abc143/tasks/abc143_a

a, b = map(int, input().strip().split())
res = max(0, a - 2 * b)
print(res)
 a, b = map(int, input().strip().split()) a map(int, input().strip().split()) map int input().strip().split() ().strip().split ().strip() ().strip () input strip split b res = max(0, a - 2 * b) res max(0, a - 2 * b) max 0 a - 2 * b a 2 * b 2 b print(res) print res res = max(0, a - 2 * b) max(0, a - 2 * b) res b = map(int, input().strip().split()) map(int, input().strip().split()) b a, b = map(int, input().strip().split()) map(int, input().strip().split()) a
# 問題：https://atcoder.jp/contests/abc143/tasks/abc143_a

a, b = map(int, input().strip().split())
res = max(0, a - 2 * b)
print(res)

