unsigned long long int gcd(int x, int y){ while(x != 0){ int z = x; x = y%x; y = z; } return y; } unsigned long long int lcm(int x, int y){ int p = gcd(x, y); int s = x*y/p; return s; } unsigned long long int main(){ unsigned long long int t, a, b, l, c, d, e, f; scanf("%llu%llu%llu", &t, &a, &b); l = lcm(a, b); if (t%a == 0){ d = t/a; } else { d = 1+t/a; } if (t%b == 0){ e = t/b; } else { e = 1+t/b; } if (t%l == 0){ f = t/l; } else { f = 1+t/l; } c = d+e-f; printf("%llu\n", c); return 0; }