#include #include using namespace std; namespace mp = boost::multiprecision; using ll = long long; using Pll = pair; using Pii = pair; constexpr ll MOD = 1000000007; constexpr long double EPS = 1e-10; constexpr int dyx[4][2] = { { 0, 1}, {-1, 0}, {0,-1}, {1, 0} }; mp::cpp_int gcd(mp::cpp_int a, mp::cpp_int b){ if(b == 0) return a; else return gcd(b, a%b); } mp::cpp_int lcm(mp::cpp_int a, mp::cpp_int b) { return a / gcd(a, b) * b; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); mp::cpp_int t, a, b; cin >> t >> a >> b; mp::cpp_int l = lcm(a, b); mp::cpp_int ans = ((t-1)/a+1) + ((t-1)/b+1) - ((t-1)/l+1); cout << ans << endl; }