#!/bin/bash
read N A B
if [ "$A" -eq 0 ];then 
  echo 0
  exit
fi;
W="$(( A + B ))"
M="$((N%W))"
_M="$([ "$((M % A))" -ne "0" ] && echo $((M % A)) || echo $A)"

#echo $N, $W
#echo $M,$_M

echo "$(((N/W*A)+_M))"
