import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long answer = 0;
        if (n % (a + b) == 0) {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } else if (n % (a + b) > a) {
            answer = a * (n / (a + b)) + a;
        } else {
            answer = a * (n / (a + b)) + (n % (a + b));
        }
        System.out.println(answer);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long answer = 0;
        if (n % (a + b) == 0) {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } else if (n % (a + b) > a) {
            answer = a * (n / (a + b)) + a;
        } else {
            answer = a * (n / (a + b)) + (n % (a + b));
        }
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long answer = 0;
        if (n % (a + b) == 0) {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } else if (n % (a + b) > a) {
            answer = a * (n / (a + b)) + a;
        } else {
            answer = a * (n / (a + b)) + (n % (a + b));
        }
        System.out.println(answer);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long answer = 0;
        if (n % (a + b) == 0) {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } else if (n % (a + b) > a) {
            answer = a * (n / (a + b)) + a;
        } else {
            answer = a * (n / (a + b)) + (n % (a + b));
        }
        System.out.println(answer);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long answer = 0; answer 0 if (n % (a + b) == 0) {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } else if (n % (a + b) > a) {
            answer = a * (n / (a + b)) + a;
        } else {
            answer = a * (n / (a + b)) + (n % (a + b));
        } n % (a + b) == 0 n % (a + b) n (a + b) a b 0 {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            } n < a+b n a+b a b {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                } n < a n a {
                    answer = n;
                } answer = n answer n {
                    answer = a;
                } answer = a answer a {
                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 {
            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 sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long answer = 0;
        if (n % (a + b) == 0) {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } else if (n % (a + b) > a) {
            answer = a * (n / (a + b)) + a;
        } else {
            answer = a * (n / (a + b)) + (n % (a + b));
        }
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long answer = 0;
        if (n % (a + b) == 0) {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } else if (n % (a + b) > a) {
            answer = a * (n / (a + b)) + a;
        } else {
            answer = a * (n / (a + b)) + (n % (a + b));
        }
        System.out.println(answer);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long answer = 0;
        if (n % (a + b) == 0) {
            if (n < a+b) {
                if (n < a) {
                    answer = n;
                } else {
                    answer = a;
                }
            } else {
                answer = a * (n / (a + b));
            }
        } else if (n % (a + b) > a) {
            answer = a * (n / (a + b)) + a;
        } else {
            answer = a * (n / (a + b)) + (n % (a + b));
        }
        System.out.println(answer);
    }
}