def I(): return map(int, input().split()) L, R = I() ans = 0 ans += L < 296 <= R ans += L < 417 <= R print(ans)