#include typedef uint32_t u32; typedef uint64_t u64; typedef int32_t s32; typedef int64_t s64; s32 ri() { s32 n; scanf("%" SCNd32, &n); return n; } struct UnionFind { std::vector data; UnionFind (int size) : data(size, -1) {} bool unite(int x, int y) { x = root(x); y = root(y); if (x != y) { if (data[y] < data[x]) std::swap(x, y); data[x] += data[y]; data[y] = x; } return x != y; } bool same(int x, int y) { return root(x) == root(y); } int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); } int size(int x) { return -data[root(x)]; } bool connected() { return size(0) == (int) data.size(); } }; int main() { #define int WHOOOO // 脱int訓練中につき許して s32 l = ri(), r = ri(); UnionFind uni(r + 1); for (s32 i = l; i <= r; i++) for (s32 j = i * 2; j <= r; j += i) uni.unite(i, j); std::set all; for (s32 i = l; i <= r; i++) all.insert(uni.root(i)); printf("%" PRId32 "\n", (s32) all.size() - 1); return 0; }