using System.Numerics; 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]); getAns(t, a, b); } static void getAns(long t, long a, long b) { var gcd = Gcd(a, b); BigInteger lcm = (BigInteger)a / gcd * b; var a1 = (t - 1) / a + 1; var a2 = (t - 1) / b + 1; var a3 = (t - 1) / lcm + 1; Console.WriteLine(a1 + a2 - a3); } 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; } }