import sys
input = sys.stdin.readline

a, b = map(int, input().split())
if a > b * 2:
    ans = a - b * 2
else:
    ans = 0
print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b if a > b * 2:
    ans = a - b * 2
else:
    ans = 0 a > b * 2 a b * 2 b 2 ans = a - b * 2 ans a - b * 2 a b * 2 b 2 ans = 0 ans 0 print(ans) print ans a, b = map(int, input().split()) map(int, input().split()) a ans = 0 0 ans input = sys.stdin.readline sys.stdin.readline input ans = a - b * 2 a - b * 2 ans b = map(int, input().split()) map(int, input().split()) b
import sys
input = sys.stdin.readline

a, b = map(int, input().split())
if a > b * 2:
    ans = a - b * 2
else:
    ans = 0
print(ans)
