l, k = map(int, input().split(' ')) cnt = 0 print((l-2*k)//2)