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

ans = a - min(a, 2 * b)
print(ans) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b ans = a - min(a, 2 * b) ans a - min(a, 2 * b) a min(a, 2 * b) min a 2 * b 2 b print(ans) print ans ans = a - min(a, 2 * b) a - min(a, 2 * b) ans b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
a, b = map(int, input().split())

ans = a - min(a, 2 * b)
print(ans)
