import java.util.*; import java.math.*; public class Main { public static void main(String[] args) throws Exception { Scanner scanner = new Scanner(System.in); BigDecimal t = scanner.nextBigDecimal(); BigDecimal x = scanner.nextBigDecimal(); BigDecimal y = scanner.nextBigDecimal(); BigDecimal z = lcm(x, y); scanner.close(); BigDecimal ans = BigDecimal.ZERO; ans = ans.add(t.divide(x, BigDecimal.ROUND_UP)); ans = ans.add(t.divide(y, BigDecimal.ROUND_UP)); ans = ans.subtract(t.divide(z, BigDecimal.ROUND_UP)); System.out.println(ans.toPlainString()); } private static BigDecimal gcd(BigDecimal x, BigDecimal y) { if (x.compareTo(y) < 0) return _gcd(y, x); return _gcd(x, y); } private static BigDecimal _gcd(BigDecimal x, BigDecimal y) { BigDecimal r = x.remainder(y); if(r.compareTo(BigDecimal.ZERO) == 0) return y; return _gcd(y, r); } private static BigDecimal lcm(BigDecimal x, BigDecimal y) { return x.multiply(y).divide(gcd(x, y)); } }