#define _GLIBCXX_DEBUG #include "bits/stdc++.h" //#include //AtCoder (gcc) 上ではこれがあると動かない。__popcnt用のincludeファイル。 using namespace std; typedef long long ll; typedef long double ld; #define int long long #define rep(i, n) for(long long i = 0; i < (n); i++) #define sqrt(d) pow((long double) (d), 0.50) const int INF = 2000000000; //2e9 const long long INF2 = 8000000000000000000; //8e18 const int large_P = 1000000007; //1e9 + 7 //const int large_P = 1000000009; //1e9 + 9 //const int large_P = 998244353; signed main() { int L, R; cin >> L >> R; int N = R - L + 1; int res = 0; vector remain(N, true); int false_count = 0; if (L == 1) { res = 0; } else { rep(i, N) { if (!remain.at(i)) continue; else { int j = 1; while ((i + L) * (j + 1) <= R) { if (remain.at((i + L) * (j + 1) - L)) { false_count++; } remain.at((i + L) * (j + 1) - L) = false; j++; } } } rep(i, N) { if (remain.at(i)) res++; } res--; } cout << res << endl; //rep(i, N) if (remain.at(i)) cout << i + L << endl; }