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