import java.math.BigInteger; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); BigInteger T = scanner.nextBigInteger(), A = scanner.nextBigInteger(), B = scanner.nextBigInteger(); scanner.close(); System.out.print(BigInteger.ONE.add(T.subtract(BigInteger.ONE).divide(A)).add(T.subtract(BigInteger.ONE).divide(B)).subtract(T.subtract(BigInteger.ONE).divide(A.multiply(B).divide(A.gcd(B))))); } }