#include using namespace std; int main() { long long T, A, B; cin >> T >> A >> B; long long ans = (T - 1) / A + (T - 1) / B - ((T - 1) / A) / (B / gcd(A, B)) + 1; cout << ans << endl; return 0; }