a, b = io.read("*n", "*n") c = 0 if a < 296 and 295 < b then c = c + 1 end if a < 417 and 416 < b then c = c + 1 end print(c)