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