L, R = map(int, input().split()) ans = 0 if L <= 295: ans += 1 if not (R <= 295 or 417 <= L): ans += 1 if 417 <= R: ans += 1 print(ans - 1)