import java.util.*; import java.math.BigDecimal; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long t = sc.nextLong(); long a = sc.nextLong(); long b = sc.nextLong(); long ans = 2 + (t - 1) / a; long g = gcd(a, b); long g1 = g * (a / g) * (b / g); BigDecimal ba = new BigDecimal(a); BigDecimal bb = new BigDecimal(b); BigDecimal bg = new BigDecimal(g); BigDecimal ag = ba.multiply(bb); ag = ag.divide(bg); if((ag.compareTo(new BigDecimal(Long.MAX_VALUE))) <= 0) { ans -= (1 + (t - 1) / g1); } else { ans -= 1; } ans += (t - 1) / b; System.out.println(ans); } public static long gcd(long a, long b) { if(b == 0) return a; return gcd(b, (a % b)); } }