#include using namespace std; using lint = long long; template using V = vector; template using VV = V< V >; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); lint t, a, b; cin >> t >> a >> b; lint m = a / __gcd(a, b); m = m <= (t + b - 1) / b ? m * b : (lint)9e18; lint res = (t + a - 1) / a + (t + b - 1) / b - (t + m - 1) / m; cout << res << '\n'; }