read SELECTNUM
read BLUE
read RED

ANS_TMP=$(( $(($SELECTNUM / $(($BLUE + $RED)) )) * $BLUE))
REM=$(($SELECTNUM % $(($BLUE + $RED)) ))

if [ $REM -lt $BLUE ] ; then
  ANS=$(( $ANS_TMP + $REM ))
else
  ANS=$(( $ANS_TMP + $BLUE ))
fi

echo $ANS

exit 0