#53510: 這樣也行阿


s410129@student.cysh.cy.edu.tw (簡劭紘)


a, b = map(int, input().split())
print( max(0, ((b - (b % 2)) - (a + (a % 2))) // 2 + 1) )