import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        long answer = 0;
        if (A >= N) {
            answer = N;
        } else if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        }

        System.out.println(answer);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        long answer = 0;
        if (A >= N) {
            answer = N;
        } else if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        }

        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        long answer = 0;
        if (A >= N) {
            answer = N;
        } else if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        }

        System.out.println(answer);
    } main {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        long answer = 0;
        if (A >= N) {
            answer = N;
        } else if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        }

        System.out.println(answer);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long N = scanner.nextLong(); N scanner.nextLong() scanner.nextLong scanner long A = scanner.nextLong(); A scanner.nextLong() scanner.nextLong scanner long B = scanner.nextLong(); B scanner.nextLong() scanner.nextLong scanner long answer = 0; answer 0 if (A >= N) {
            answer = N;
        } else if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        } A >= N A N {
            answer = N;
        } answer = N answer N if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        } A + B > N A + B A B N {
            answer = A;
        } answer = A answer A {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        } if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            } A + B != 0 A + B A B 0 {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            } long numberOfBToAdd = N / (A + B); numberOfBToAdd N / (A + B) N (A + B) A B answer = numberOfBToAdd * A answer numberOfBToAdd * A numberOfBToAdd A long additional = N % (A + B); additional N % (A + B) N (A + B) A B if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                } A != 0 A 0 {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                } if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    } additional >= A additional A {
                        answer += A;
                    } answer += A answer A {
                        answer += additional;
                    } answer += additional answer additional System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        long answer = 0;
        if (A >= N) {
            answer = N;
        } else if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        }

        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        long answer = 0;
        if (A >= N) {
            answer = N;
        } else if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        }

        System.out.println(answer);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        long answer = 0;
        if (A >= N) {
            answer = N;
        } else if (A + B > N) {
            answer = A;
        } else {
            if (A + B != 0) {
                long numberOfBToAdd = N / (A + B);
                answer = numberOfBToAdd * A;
                long additional = N % (A + B);
                if (A != 0) {
                    if (additional >= A) {
                        answer += A;
                    } else {
                        answer += additional;
                    }
                }
            }
        }

        System.out.println(answer);
    }
}