如代码注释

import math
l, r = map(int, input().split())
n = math.floor(r/2)-math.ceil(l/2)+1#左边界除二向上取整,右边界除二向下取整,确保数字都能位于区间内
print(n)