#include <iostream> 
#define ll long long 
using namespace std;
int main(){
	ll n,a,b;
	cin>>n>>a>>b;
	if(a==0)cout<<'0'<<endl;
	else{
		ll sh=n/(a+b);
		if(sh==0)cout<<a<<endl;
		else{
			ll yu=n%(a+b);
			ll ans;
			if(yu<=a)ans=sh*a+yu;
			else ans=(sh+1)*a;
			cout<<ans<<endl;
		}
	}
	return 0;
} 
