using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var t = long.Parse(line[0]); var a = long.Parse(line[1]); var b = long.Parse(line[2]); var gcd = Gcd(a, b); var tpa = t / a; if (t % a == 0) tpa--; var tpb = t / b; if (t % b == 0) tpb--; var tpLcm = t * gcd / a / b; if ((t * gcd / a) % b == 0) tpLcm--; var ans = tpa + tpb + 1 - tpLcm; Console.WriteLine(ans); } static long Gcd(long a, long b) { if (a < b) return Gcd(b, a); while (b != 0) { var w = a % b; a = b; b = w; } return a; } }