#include "bits/stdc++.h" using namespace std; void solve() { long t, a, b; cin >> t >> a >> b; long g = __gcd(a, b), c = a * b / g; if (c > 0) { cout << (t + a - 1) / a + (t + b - 1) / b - (t + c - 1) / c << endl; } else { cout << (t + a - 1) / a + (t + b - 1) / b << endl; } } int main() { solve(); return 0; }