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 (n < a) {
            answer = n;
        } else if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        }
        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 (n < a) {
            answer = n;
        } else if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        }
        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 (n < a) {
            answer = n;
        } else if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        }
        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 (n < a) {
            answer = n;
        } else if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        }
        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 (n < a) {
            answer = n;
        } else if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        } n < a n a {
            answer = n;
        } answer = n answer n if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        } n <= a + b n a + b a b {
            answer = a;
        } answer = a answer a if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        } n > a + b n a + b a b {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        } if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            } n % (a + b) == 0 n % (a + b) n (a + b) a b 0 {
                answer = a * (n / (a + b));
            } answer = a * (n / (a + b)) answer a * (n / (a + b)) a (n / (a + b)) n (a + b) a b if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            } n % (a + b) >= a n % (a + b) n (a + b) a b a {
                answer = a * (n / (a + b)) + a;
            } answer = a * (n / (a + b)) + a answer a * (n / (a + b)) + a a * (n / (a + b)) a (n / (a + b)) n (a + b) a b a {
                answer = a * (n / (a + b)) + n % (a + b);
            } answer = a * (n / (a + b)) + n % (a + b) answer a * (n / (a + b)) + n % (a + b) a * (n / (a + b)) a (n / (a + b)) n (a + b) a b n % (a + b) n (a + b) a b 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 (n < a) {
            answer = n;
        } else if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        }
        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 (n < a) {
            answer = n;
        } else if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        }
        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 (n < a) {
            answer = n;
        } else if (n <= a + b) {
            answer = a;
        } else if (n > a + b) {
            if (n % (a + b) == 0) {
                answer = a * (n / (a + b));
            } else if (n % (a + b) >= a) {
                answer = a * (n / (a + b)) + a;
            } else
            //(n%a+b<a)
            {
                answer = a * (n / (a + b)) + n % (a + b);
            }

        }
        System.out.println(answer);
    }
}
