import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long ans = 0;
        if(A == 0)
        {
            System.out.println(ans);
        }
        else
        {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long ans = 0;
        if(A == 0)
        {
            System.out.println(ans);
        }
        else
        {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long ans = 0;
        if(A == 0)
        {
            System.out.println(ans);
        }
        else
        {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long ans = 0;
        if(A == 0)
        {
            System.out.println(ans);
        }
        else
        {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        }
    } 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 ans = 0; ans 0 if(A == 0)
        {
            System.out.println(ans);
        }
        else
        {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        } A == 0 A 0 {
            System.out.println(ans);
        } System.out.println(ans) System.out.println System.out System System.out ans {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        } long a = A + B; a A + B A B long b = N % a; b N % a N a long c = N / a; c N / a N a if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            } b<A b A {
                ans = A * c + b;
                System.out.println(ans); 
            } ans = A * c + b ans A * c + b A * c A c b System.out.println(ans) System.out.println System.out System System.out ans if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            } b>=A b A {
                ans = A * c + A;
                System.out.println(ans); 
            } ans = A * c + A ans A * c + A A * c A c A System.out.println(ans) System.out.println System.out System System.out ans {
                ans = A * c;
                System.out.println(ans);
            } ans = A * c ans A * c A c System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long ans = 0;
        if(A == 0)
        {
            System.out.println(ans);
        }
        else
        {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long ans = 0;
        if(A == 0)
        {
            System.out.println(ans);
        }
        else
        {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long ans = 0;
        if(A == 0)
        {
            System.out.println(ans);
        }
        else
        {
            long a = A + B; //青と赤の足し算
            long b = N % a; // 余
            long c = N / a; // 商
            if(b<A)
            {
                ans = A * c + b;
                System.out.println(ans); 
            }
            else if(b>=A)
            {
                ans = A * c + A;
                System.out.println(ans); 
            }
            else 
            {
                ans = A * c;
                System.out.println(ans);
            }
        }
    }
}