const fi='BL3.INP';
fo='BL3.OUT';
var n,a,b,i:longint;
function gcd(a,b:longint):longint;
var t:longint;
begin
while b<>0 do
begin
t:=a mod b;
a:=b;
b:=t;
end;
exit(a);
end;
begin
assign(input,fi);
reset(input);
read(n,a,b);
close(input);
assign(output,fo);
rewrite(output);
if not (n mod gcd(a,b)=0) then
begin
write(-1);
exit;
end;
for i:=n div b downto 0 do
if (n-i*b) mod a=0 then
begin
write(i+(n-i*b) div a);
exit;
end;
write(-1);
close(output);
end.