a,b=map(int,input().split())
B=b*2
if a>B:
  print(a-B)
else:
  print('0') a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b B=b*2 B b*2 b 2 if a>B:
  print(a-B)
else:
  print('0') a>B a B print(a-B) print a-B a B print('0') print '0' B=b*2 b*2 B 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())
B=b*2
if a>B:
  print(a-B)
else:
  print('0')