N,A,B=map(int,input().split()) N-=2 N%=A+B if N