Misha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he receives one point and the loser receives nothing. Once one of the players scores exactly k points, the score is reset and a new set begins.Across all the sets Misha scored a points in total, and Vanya scored b points. Given this information, determine the maximum number of sets they could have played, or that the situation is impossible.Note that the game consisted of several complete sets.

The first line contains three space-separated integers k, a and b (1 ≤ k ≤ 109, 0 ≤ a, b ≤ 109, a + b > 0).

If the situation is impossible, print a single number -1. Otherwise, print the maximum possible number of sets.

NoteNote that the rules of the game in this problem differ from the real table tennis game, for example, the rule of "balance" (the winning player has to be at least two points ahead to win a set) has no power within the present problem.

var k,a,b,sc1,sc2:integer;
begin
readln(k,a,b);
sc1:=a div k;
a:=a mod k;
sc2:=b div k;
b:=b mod k;
If (a>0)and(sc2=0)
 then writeln(-1)
 else if (b>0)and(sc1=0)
       then writeln(-1)
       else writeln(sc1+sc2);
end.

  const eps=0.000000001;
   besk=9000000000000000008;  nn=200000;
   label 1,2,3;
    type   { real=double;}  {string=ansistring;}
    mas=array [0..nn] of longint;   point=record x,y,z:real;end;
    zap=record p1,p2,p3 :int64;end; zap1=^zap;
    mass=array[0..nn] of longint;mass1=^mass;
    var aa,bb,left,right,modul,ot3,ot2,ot1,nap,posx,posy,xx,yy,n,m,tt1,tt2,q,pp,tt,dx,dy,mmin,kk,gr,ttt,t,kol,pos,x1,x2,p,pmax,imax,p1,p2,p3,p4,l,ot,nm,s1,s2,s,smin,cen,dl,t2,i1:int64;
    t1,k,time,jj,step, ii,i,j:longint;
    { aa,bb,cc:double;
    }
    ss2,sss,ss,ss1:string;
    last:array[-1..5000,0..25] of int64;
     dd,npx,npy:array[-1000..500000] of int64;
     zifr:array[0..1000000,0..9] of longint;
    sdv, dp,binom:array[-1..500,-1..500] of int64;
     prost,zan:array[-10000..10000000] of boolean;
     kolnap  :array[0..31,-200..200,-200..200] of longint;
     finnap: array[0..31,-1..20,-200..200,-200..200] of byte;
     c,z,x,y,aold,b,a:array[-100000..1000002] of int64;
     dda:array[-10..12000] of extended;
   zanx,zany:array[-10..200000] of boolean;
   polog:array[-10..200004, 0..5] of int64;
    corr,zzan:array[-1000..3000,-1000..3000] of boolean;
    ssss:array[-1000..1000000] of string;
     fl:array[-10000..600000] of boolean;
    ch:char;
    pole1,pole :array [-10..2000,-10..2000] of char;
    st:array[-10..100000] of string;
    st2:array[0..nn] of string;
     v0,v1,s0,t0:real;
     zv:point;
     newx,newy:array[-1..200000] of int64;

     yot:double;
       flag2,oldflag,flag,flag1:boolean;
    function al(x,y:extended):extended; var t0,t1,p,s0,s1:extended;
 begin
     if (x>0)and(y>=0) then p:=arctan(y/x);
     if x<0 then p:=pi+arctan(y/x);
     if(x>0)and(y<0) then p:=2*pi+arctan(y/x);
     if x=0 then if (y>=0) then p:=pi/2 else p:=3*pi/2;
     al:=p/pi*180;
 end;
  function min(x,y:int64):int64;begin min:=x;if y<x then min:=y; end;
  function max(x,y:int64):int64;begin max:=x;if y>x then max:=y; end;

  function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

begin
 {  assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
  }

      readln(p,aa,bb);
      if min(aa,bb)<p then
        begin
          t:=max(aa,bb);
          if t mod p=0 then write(t div p) else write(-1);
          goto 1;

        end;

        writeln((aa div p)+(bb div p));

1:          close(output);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a, b, k: int64;

begin
  readln(k, a, b);
  if ((a mod k <> 0) and (b div k = 0)) or ((a div k = 0) and (b mod k <> 0)) then
  begin
    writeln(-1);
    halt(0);
  end;
  writeln(a div k + b div k);
end.

program f3;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  a, b, k, n1, n2: integer;
begin
  readln(k, a, b);
  n1 := a div k;
  n2 := b div k;
  a := a mod k;
  b := b mod k;
  if ((a <> 0) and (n2 = 0)) or ((b <> 0) and (n1 = 0)) or ((n1 + n2) = 0) then
    writeln(-1)
  else writeln(n1 + n2);
  readln;
end.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q-,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE CONSOLE}

const filename='a';
      oo=maxlongint div 2;
      eps=1e-6;
      eee=1e-21;

var qq,cc,a,aa:array[0..1000000]of longint;
    qc,he:array[0..2014,0..2014]of longint;
    s,ss,sss,s0,s1,s2,s3:string;
    x,y,z,xx,yy,zz,x0,y0,z0,x1,x2,x3,y1,y2,y3,z1,z2,z3:extended;
    nt,ii,jj,n,m,q,c,q0,c0,q1,c1,q2,c2,q3,c3:longint;
    nn,mm,kk,u,v,res,cur,max,min:longint;
    test,ll,t,tt:longint;
    b,bb,bbb,b0,b1,b2,b3:boolean;

function mx(q,c:longint):longint;
  begin
  if q>c then mx:=q else mx:=c;
  end;

function mn(q,c:longint):longint;
  begin
  if q<c then mn:=q else mn:=c;
  end;

procedure init;
  begin
  assign(input,filename+'.in');
  assign(output,filename+'.out');
  reset(input);
  rewrite(output);
  end;

procedure fin;
  begin
  close(input);
  close(output);
  end;

procedure clear;
var i,j,k:longint;
  begin
  fillchar(qc,sizeof(qc),0);
  end;

procedure load;
var i,j,k:longint;
  begin
  end;

procedure save;
var i,j,k:longint;
  begin
  end;

procedure run;
var i,j,k:longint;
  begin
  //init;
  readln(k,n,m);
  if n<m then begin nn:=n; n:=m; m:=nn; end;
  if m>=k then res:=n div k+m div k else
    begin
    if n mod k=0 then res:=n div k else res:=-1;
    end;
  writeln(res);
  //fin;
  end;

begin
nt:=1;
//readln(nt);
for test:=1 to nt do
  begin
  clear;
  load;
  run;
  save;
  end;
end.

var k,a,b:longint;
begin
readln(k,a,b);
if (a div k = 0) and (b div k = 0) or
        (b div k = 0) and (a mod k>0) or
        (a div k = 0) and (b mod k>0)
        then write(-1) else
        write((a div k) + (b div k));
end.

var
 n,i,x : longint;
 a,b,kol,k : longint;

begin

  readln(k,a,b);

  kol:= a div k + b div k;

  if ( a mod k > 0) and (b div k = 0)
   then kol:=-1;

  if ( b mod k > 0) and (a div k = 0)
   then kol:=-1;

   writeln(kol);

end.

var
  a,b,i,n,k,j:longint;
  cnt:array[1..1111]of longint;
  was:array[1..26]of boolean;
  ch:char;
  x:array[1..111]of char;
begin
  read(k,a,b);
  if (a<k) and (b<k) then begin writeln(-1);halt;end;

    if (b<k) and (a mod k<>0) then begin writeln(-1);halt;end;
    if (a<k) and (b mod k<>0) then begin writeln(-1);halt;end;
  writeln(a div k+b div k);
end.

program ix;

var
  k, a, b, s: integer;

begin
  readln(k, a, b);
  s := (a div k) + (b div k);
  if ((a mod k > 0) and (b div k = 0)) or ((b mod k > 0) and (a div k = 0)) then s := 0;
  if (s = 0) then writeln(-1) else writeln(s);
end.

var k,a,b,c,ans:longint;

function max(a,b:longint):longint;
begin
  if a>b then exit(a)
         else exit(b);
end;

begin
  readln(k,a,b);
  c:=max(a,b);
  if c<k then begin
                writeln(-1);
                halt;
              end;
  if ((a=0)and(b mod k<>0))or((b=0)and(a mod k<>0)) then begin
                                                           writeln(-1);
                                                           halt;
                                                         end;
  if (a<k)and(b>k)and(b mod k<>0)then begin
                                        writeln(-1);
                                        halt;
                                      end;
  if (b<k)and(a>k)and(a mod k<>0)then begin
                                        writeln(-1);
                                        halt;
                                      end;
  ans:=ans+(a div k);
  ans:=ans+(b div k);
  writeln(ans);
end.

program j01;
var ans,k,a,b,d,aa,bb:int64;
procedure swap(var a,b:int64);
var c:int64;
begin
  c:=a;a:=b;b:=c;
end;
begin
  readln(k,a,b);
  ans:=0;
  if a<b then swap(a,b);
  aa:=a div k;bb:=b div k;
  if(aa=0)and(b mod k>0)then
  begin
    writeln(-1);halt;
  end;
  if(bb=0)and(a mod k>0)then
  begin
    writeln(-1);halt;
  end;
  writeln(aa+bb);
end.

var k,a,b: longint;
begin
    readln(k,a,b);
    if ((a mod k <>0)and(b <k))
    or ((b mod k <>0)and(a <k)) then write(-1) else write( (a div k)+(b div k));
end.

var k,a,b: longint;
begin
readln (k,a,b);
if (a=0) and (b mod k=0) then writeln (b div k) else
if (a=0) and (b mod k<>0) then writeln ('-1') else
if (b=0) and (a mod k=0) then writeln (a div k) else
if (b=0) and (a mod k<>0) then writeln ('-1') else
if ((a>=k) and (b>=k)) or ((a=k) or (b=k)) or ((a mod k=0) or (b mod k=0)) then writeln (a div k + b div k)
else writeln ('-1');
end.

VAR k,a,b:int64;
BEGIN
 read(k,a,b);
      if(a div k>0)and(b div k>0)then write((a div k)+(b div k))
 else if a div k>0 then if a mod k=0 then write(a div k)
                                     else write(-1)
 else if b div k>0 then if b mod k=0 then write(b div k)
                                     else write(-1)
 else write(-1);
END.

var n,a,b,k,m,p:int64;
begin
   {assign(input,'input.txt');
   assign(output,'output.txt');
   reset(input);
   rewrite(output);}
   read(k,a,b);
   n:=a div k;
   m:=b div k;
   p:=n+m;
   if (n+m=0)or((m=0)and(a mod k>0))or((n=0)and(b mod k>0)) then p:=-1;
   write(p);
end.

program dav;
var ansa,ansb: int64;
a,b,k: longint;

procedure stop;
begin
write(-1);
halt;
end;

begin
{assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output); }
read(k,a,b);
if (a<k) and (b<k) then stop;
ansa:=(a div k);
a:=a mod k;
ansb:=(b div k);
b:=b mod k;
if ansa*(k-1)<b then stop;
if ansb*(k-1)<a then stop;
write(ansa+ansb);
end.

var k,a,b:longint;
begin
  readln(k,a,b);
  if ((a div k = 0) and (b mod k > 0)) or ((a mod k > 0) and (b div k = 0)) then writeln(-1) else writeln(a div k + b div k);
end.

const fi='TTG2.inp';
      fo='TTG2.out';
var k,a,b:longint;
procedure mo;
begin
    assign(input,fi);
    reset(input);
    assign(output,fo);
    rewrite(output);
end;

procedure nhap;
begin
    readln(k,a,b);
    if (a < k)and(b<k) then
    begin
        writeln('-1');
        exit;
    end
    else
    begin
       if(a=0)and(b mod k <>0) then
       begin
            writeln('-1');
            exit;
       end;
       if(a mod k <>0)and(b =0) then
       begin
           writeln('-1');
            exit;
       end;

       if(a mod k =0)or(b mod k =0) then
       begin
        writeln((a div k)+(b div k));
        exit;
       end
       else
       begin
        if (a <k)or(b<k) then
            writeln('-1')
        else
        begin
            if((a <> 0)and(b <> 0))then
                writeln((a div k)+(b div k))
            else
                writeln('-1');
        end;
       end;
    end;
end;

begin

    nhap;
end.

var a,b,c,dop:longint;
begin
  readln(a,b,c);
  if b<=c then begin
                 dop:=c;
                 c:=b;
                 b:=dop;
                end;
  if (b mod a<>0)and(c<a) then writeln(-1)
                          else writeln((c div a)+(b div a));
end.

var a,b,k:int64;
procedure   mo;
begin
    assign(input,'test.inp');reset(input);
    assign(output,'test.out');rewrite(output);
end;
procedure   dong;
begin
    close(input);close(output);
end;
procedure   nhap;
begin
    readln(k,a,b);
end;
procedure   xuli;
var dem1,dem2:int64;
begin
    if (a mod k<>0) and (b<k)
    or (b mod k<>0) and (a<k) then writeln(-1) else writeln((a div k)+(b div k));
end;
begin
   // mo;
    nhap;
    xuli;
    //dong;
end.

var k,a,b,a1,b1:longint;
begin
read(k,a,b);
a1:=a div k;
b1:=b div k;
if (a1+b1<1)or((a1=0)and(b1*k<>b))or((b1=0)and(a1*k<>a)) then writeln('-1') else
writeln(a1+b1);
end.

var k,a,b,t:integer;
    m,n,x,y:integer;
procedure nhap;
  begin
        readln(k,a,b);
  end;
procedure xuly;
  begin
        m:=a div k;x:=a mod k;
        n:=b div k;y:=b mod k;

        //writeln(m,' ',n,' ',x,' ',y);

        if a=0 then
          begin if (y=0) and (n>0) then writeln(n)
                else writeln(-1);
          end
        else
        if b=0 then
          begin if (x=0) and (m>0) then writeln(m)
                else writeln(-1);
          end
        else
        begin
        if (m=0) or (n=0) then
          begin if (x<>0) and (y<>0) then writeln(-1)
                else
                if m>n then
                  begin if m>0 then writeln(m) else writeln(-1);
                  end
                else
                  begin if n>0 then writeln(n) else writeln(-1);
                  end
          end
        else
          begin t:=n+m;
                writeln(t);
          end;
        end;
  end;
begin
        //clrscr;
        nhap;
        xuly;
        //readln;
end.

var a,b,k:longint;
begin
readln(k,a,b);
if (a mod k<>0) and (b<k) or (b mod k<>0) and (a<k) then
        begin
                writeln(-1);
                halt;
        end;
if a div k +b div k=0 then writeln(-1) else
writeln(a div k+b div k);
end.

  var K , A , B : LongInt;
      A1 , B1 , tmp : LongInt;
      cant : Boolean;
begin
  readLn ( K , A , B ) ;

  cant := false;

  A1 := A div K;
  B1 := B div K;

  if ( A1 + B1 = 0 ) then
  begin
    Cant := true;
  end;

  if ( B1 > A1 ) then
  begin
    tmp := B1;
    B1 := A1;
    A1 := tmp;

    tmp := B;
    B := A;
    A := tmp;
  end;

  if ( B1 = 0 ) then
  begin

    if ( A mod K <> 0 ) then
      Cant := true;

  end;

  if ( cant ) then
    writeLn ( -1 )
  else
	writeLn ( A1 + B1 );

end.

var a,b,k,k1,k2:longint;
begin
 read(k,a,b);
 if ((a mod k <> 0) and (a div k > 0) and (b div k > 0)) or
    ((b mod k <> 0) and (b div k > 0) and (a div k > 0)) or
    ((a mod k = 0) and (a+b>=k) and (a<>0)) or
    ((b mod k = 0) and (a+b>=k) and (b<>0)) then
             write((a div k) + (b div k)) else write(-1);
end.

var k,a,b,x,y,x1,y1:int64;
begin
  readln(k,a,b);
  x:=a div k;
  y:=b div k;
  x1:=a mod k;
  y1:=b mod k;
  if (x1<>0) and (y=0) then writeln(-1)
  else if (y1<>0) and (x=0) then writeln(-1)
  else writeln(x+y);

end.

var k,a,b:int64;
    ans:boolean;
begin
  readln(k,a,b);
  if (a<k) and (b<k) then writeln(-1) else
  begin
    ans:=true;
    if (a mod k<>0) and (b<k) then ans:=false;
	if (b mod k<>0) and (a<k) then ans:=false;
	a:=a div k;b:=b div k;
    if ans then writeln(a+b) else writeln(-1);
  end;
end.

var n,a,b,f,y:int64;
begin
	readln(n,a,b);
	if (a < n) and (b < n) then begin writeln('-1'); halt; end;
	f:=a div n;
	y:=b div n;
	if (f=0) and (y*n<>b) then begin writeln('-1'); halt; end;

	if (y=0) and (f*n<>a) then begin writeln('-1'); halt; end;

	writeln((a div n) + (b div n));
end.

var k,a,b,i:longint;
begin
read(k,a,b);
if (((a-1) mod k<k-1)and((b-1) mod k<k-1))and((a div k=0)or(b div k=0)) then begin
        write(-1);
        exit;
end;
write((a div k)+(b div k));
end.

program cf;
var a,b,k,c1,c2: longint;
begin
read(k);
read(a);
read(b);
c1:=a div k;
a:=a mod k;
c2:=b div k;
b:=b mod k;
if ((c2=0) and (a>0)) or ((c1=0) and (b>0)) then
write(-1)
else
write(c1+c2);
end.

var i,j,m,n,k,a,b:longint;
begin
    readln(k,a,b);
    if (a<k) and (b<k) then begin
        writeln(-1);
        halt;
    end;
    if (a>=k) and (b<k) then begin
       if a mod k=0 then writeln(a div k) else writeln(-1);
       halt;
    end;
    if (a<k) and (b>=k) then begin
       if b mod k=0 then writeln(b div k) else writeln(-1);
       halt;
    end;
    writeln(a div k+b div k);
end.

var k,a,b:longint;
begin
read (k,a,b);
if ((a<k) and (b<k)) or ((a<k) and (b mod k > 0))
or ((b<k) and (a mod k > 0)) then write ('-1') else write (a div k+b div k);
end.

var k,a,b,i,j,ans:longint;
begin
while not eof do begin
  readln(k,a,b);
  ans:=0;
  ans:=(a div k) + (b div k);
  if ((a<k)and((b mod k)>0))or((b<k)and((a mod k)>0)) then writeln(-1) else writeln(ans);
end;
end.

var k,a,b,a1,a2,dop:int64;
begin
  readln(k,a,b);

  a1:=a div k;
  a2:=b div k;

  if a>b then begin
               a1:=a div k;
               a2:=b div k;

              end
         else begin
               a1:=b div k;
               a2:=a div k;
               dop:=a;
               a:=b;
               b:=dop;
              end;

  if (a1=0) or ((b<k) and (a mod k<>0)) then writeln(-1)
    else writeln(a1+a2);
end.

var k,a,b,n,a1,b1: longint;
begin;
read(k,a,b);
a1:=a div k;
b1:=b div k;
n:=a1+b1;
if (n=0) or ((a mod k>0) and (b1=0)) or ((b mod k>0) and (a1=0)) then write(-1) else write(n);
readln
end.

var
  a, b, c, d: int64;

begin
  readln(a, b, c);
  if (b < a) and (c < a) then begin
    writeln(-1);
    halt();
  end;
  if (b mod a > 0) and (c < a) then begin
    writeln(-1);
    halt();
  end;
  if (c mod a > 0) and (b < a) then begin
    writeln(-1);
    halt();
  end;
  writeln(b div a + c div a);
end.

var k,a,b,c:integer;
begin
readln(k,a,b);
c:=a div k + b div k;
if (c=0) or ((b mod k<>0) and (a<k)) or ((a mod k<>0) and (b<k)) then writeln(-1)
else writeln(c);
end.

var k,a,b,n,m,s:longint;
begin
  readln(k,a,b);

  n:=a div k;
  a:=a mod k;
  m:=b div k;
  b:=b mod k;
  s:=n+m;
  if ((a>0) and (a>m*(k-1))) or ((b>n*(k-1)) and (b>0)) then writeln('-1')
    else writeln(s);
end.

Program z1;
var k,a,b,s:longint;
begin
read(k,a,b);
if (a mod k=0)and(a<>0) then s:=s+(a div k)+(b div k)
                        else
                        if (b>=k)and(a div k>0) then s:=s+(a div k)+(b div k)
                                                else s:=-1;
if (a<k)and(b mod k=0)and(b<>0) then begin s:=b div k;end;
write(s);
end.

var a,s,d,f,g,h,j,k,l,ii,i,ans1,ans2,ans:longint;
begin
readln(a,s,d);
ans1:=ans1+(s div a);
ans2:=ans2+(d div a);
ans:=ans1+ans2;

if (d-ans2*a<>0)and(ans1=0) then
ans:=-1;
if (s-ans1*a<>0)and(ans2=0) then
ans:=-1;

writeln(ans);
end.

{$I-,O+,Q-,R-,S-}

var
  k, a, b: longint;
begin
  read(k); read(a); read(b);

  if (a >= k) and (b >= k) then write(a div k + b div k)
  else if (a >= k) and (a mod k = 0) then write(a div k)
  else if (b >= k) and (b mod k = 0) then write(b div k)
  else write(-1);
end.

Program round397codefN2(virtual_);
Var k, a, b, n, c: longint;

Begin
Readln(k, a, b);
 n:= (a div k) + (b div k);
 if (a mod k > 0) and (b div k = 0) then begin write(-1); halt; end
 else
  if (b mod k > 0) and (a div k = 0) then begin write(-1); halt; end
  else
   if n < 1 then write(-1) else write(n);
End.

var a,b,c:longint;s:string;q:char;
begin
 read(a,b,c);
  if ((a>b)and(a>c))or((b div a=0)and (c mod a>0))or
  ((b mod a>0)and (c div a=0))then write(-1) else write(b div a+c div a);
end.

var max,d,k,a,b:longint;
kt:boolean;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if (d=0) or ((a mod k>0) and (b div k=0))
        or ((b mod k>0) and (a div k=0)) then write(-1)
                                        else write(d);
end.

var
  k,a,b,x,y : int64;

begin
  readln(k,a,b);
  if k = 1 then begin writeln(a+b); halt; end;
  x:=a div k; y:=b div k;
  a:=a-x*k; b:=b-y*k;
  if (a div (k-1)+ord(a mod (k-1) > 0) > y) or (b div (k-1)+ord(b mod (k-1) > 0) > x) then begin writeln(-1); halt; end;
  writeln(x+y);
end.

Program p1;
var k,a,b,r:longint;
Begin
     readln(k,a,b);
     r:=a div k+b div k;
     if (a mod k<>0) and (b<k) then writeln(-1)
                               else if (b mod k<>0) and (a<k) then writeln(-1)
                                                              else if r=0 then writeln(-1)
                                                                          else writeln(r);

end.

var k,a,b,r:int64;
begin
        readln(k,a,b);
        r:=a div k+b div k;
        if (a mod k>(k-1)*(b div k)) or (b mod k>(k-1)*(a div k)) then r:=-1;
        write(r);
end.

program qq;
var i,k,b,a,x1,y1,f,x2,y2:longint;
begin
 read(k,a,b);
 x1:=a mod k;
 y1:=b mod k;
 x2:=a div k;
 y2:=b div k;
 f:= x2+y2;
 if ((x1<>0) and (y2=0)) or ((y1<>0)and(x2=0)) then writeln(-1) else writeln(f);
end.

program z1;
var a,b,c,d,i,j,k,l,m,n,ans:longint;
begin
//assign(input,'d:\input.txt'); reset(input);
//assign(output,'d:\output.txt'); rewrite(output);
readln(k,a,b);
if a<b then begin c:=a; a:=b; b:=c; end;
if (a<k) and (b<k) then begin write('-1'); exit; end;
if b<k then begin if a mod k<>0 then write('-1') else write(a div k); exit; end;
ans:=(a div k) + (b div k);
writeln(ans);
end.

var k,a,b:longint;
begin
//assign(input,'ppqbs.in');reset(input);
//assign(output,'ppqbs.out');rewrite(output);
readln(k,a,b);
if (a>=k)and(b>=k) then writeln(a div k+b div k)
else if (a>=k)and(b<k)and(a mod k=0) then writeln(a div k)
else if (b>=k)and(a<k)and(b mod k=0) then writeln(b div k)
else writeln(-1);
close(input);close(output);
end.

Program z1;
var k,a,b,s:longint;
begin
read(k,a,b);
if (a mod k=0)and(a<>0) then s:=s+(a div k)+(b div k)
                        else
                        if (b>=k)and(a div k>0) then s:=s+(a div k)+(b div k)
                                                else s:=-1;
write(s);
end.

Program z1;
var k,a,b,s:longint;
begin
read(k,a,b);
if (a mod k=0)and(b>=k) then s:=s+(a div k)+(b div k)
                        else s:=-1;
write(s);
end.

var k,a,b,sc:integer;
begin
readln(k,a,b);
sc:=a div k;
sc:=sc+ b div k;
If(a<k)and(b<k)and(sc=0)
 then writeln(-1)
 else writeln(sc);
end.

var k,a,b:longint;
begin
readln(k,a,b);
if (a div k = 0) and (b div k = 0) then write(-1) else
        write((a div k) + (b div k));
end.

var
 n,i,x : longint;
 a,b,kol,k :int64;

begin

  readln(k,a,b);

  kol:= (a+b) div k;

  if kol = 0 then kol:=-1;

   writeln(kol);

end.

var
 n,i,x : longint;
 a,b,kol,k : int64;

begin

  readln(k,a,b);

  kol:= a div k + b div k;

  if kol = 0 then kol:=-1;

   writeln(kol);

end.

var
 n,i,x : longint;
 a,b,kol,k : longint;

begin

  readln(k,a,b);

  kol:= a div k + b div k;

  if kol = 0 then kol:=-1;

   writeln(kol);

end.

var k,a,b,c,ans:longint;

function max(a,b:longint):longint;
begin
  if a>b then exit(a)
         else exit(b);
end;

begin
  readln(k,a,b);
  c:=max(a,b);
  if c<k then begin
                writeln(-1);
                halt;
              end;
  if ((a=0)and(b mod k<>0))or((b=0)and(a mod k<>0)) then begin
                                                           writeln(-1);
                                                           halt;
                                                         end;
  ans:=ans+(a div k);
  ans:=ans+(b div k);
  writeln(ans);
end.

var a,b,k: integer;
begin
    read(k,a,b);
    if (k>a)and(k>b) then write(-1) else
    begin
        if k = (a+b) then write(1) else write((a div k)+(b div k));
    end;
end.

var a,b,k: integer;
begin
    read(k,a,b);
    if ((k>a)and(k>b))or((a+b) mod k <>0) then write(-1) else
    begin
        if k = (a+b) then write(1) else write((a div k)+(b div k));
    end;
end.

var a,b,k: integer;
begin
    read(k,a,b);
    if (k>a+b) then write(-1) else
    begin
        if k = (a+b) then write(1) else write((a div k)+(b div k));
    end;
end.

var a,b,k: integer;
begin
    read(k,a,b);
    if (k>a+b) then write(-1) else
    begin
        if k = (a+b) then write(1) else write((a div k)+(b div k)+(((a mod k)+(b mod k)) div k));
    end;
end.

var a,b,k: integer;
begin
    read(k,a,b);
    if (k>a)and(k>b)and((a+b) mod k <>0) then write(-1) else
    begin
        if k = (a+b) then write(1) else write((a div k)+(b div k));
    end;
end.

var k,a,b: longint;
begin
readln (k,a,b);
if ((a>=k) and (b>=k)) or ((a=k) or (b=k)) then writeln (a div k + b div k) else writeln ('-1') end.

var k,a,b: longint;
begin
readln (k,a,b);
if (a>=k) or (b>=k) then writeln (a div k + b div k) else writeln ('-1') end.

var k,a,b: longint;
begin
readln (k,a,b);
if (a=0) and (b mod k=0) then writeln (b div k) else
if (a=0) and (b mod k<>0) then writeln ('-1') else
if (b=0) and (a mod k=0) then writeln (a div k) else
if (b=0) and (a mod k<>0) then writeln ('-1') else
if ((a>=k) and (b>=k)) or ((a=k) or (b=k)) then writeln (a div k + b div k) else writeln ('-1') end.

var n,a,b,k:int64;
begin
   {assign(input,'input.txt');
   assign(output,'output.txt');
   reset(input);
   rewrite(output);}
   read(k,a,b);
   n:=a div k+b div k;
   if n=0 then n:=-1;
   write(n);
end.

var n,a,b,k:longint;
begin
   {assign(input,'input.txt');
   assign(output,'output.txt');
   reset(input);
   rewrite(output);}
   read(k,a,b);
   n:=a div k+b div k;
   if n=0 then n:=-1;
   write(n);
end.

var k,a,b:longint;
begin
  readln(k,a,b);
  if (a div k = 0) and (b div k = 0) then writeln(-1) else writeln(a div k + b div k);
end.

const fi='TTG2.inp';
      fo='TTG2.out';
var k,a,b:longint;
procedure mo;
begin
    assign(input,fi);
    reset(input);
    assign(output,fo);
    rewrite(output);
end;

procedure nhap;
begin
    readln(k,a,b);
    if (a < k)and(b<k) then
    begin
        writeln('-1');
        exit;
    end
    else
        writeln((a div k)+(b div k));
end;

begin

    nhap;
end.

const fi='TTG2.inp';
      fo='TTG2.out';
var k,a,b:longint;
procedure mo;
begin
    assign(input,fi);
    reset(input);
    assign(output,fo);
    rewrite(output);
end;

procedure nhap;
begin
    readln(k,a,b);
    if (a < k)and(b<k) then
    begin
        writeln('-1');
        exit;
    end
    else
    begin
        if(((a mod k)+(b mod k))mod k = 0)or((a mod k =0)or(b mod k=0)) then
            writeln((a div k)+(b div k))
        else
            writeln('-1');
    end;
end;

begin

    nhap;
end.

const fi='TTG2.inp';
      fo='TTG2.out';
var k,a,b:longint;
procedure mo;
begin
    assign(input,fi);
    reset(input);
    assign(output,fo);
    rewrite(output);
end;

procedure nhap;
begin
    readln(k,a,b);
    if (a < k)and(b<k) then
    begin
        writeln('-1');
        exit;
    end
    else
    begin
       if((a mod k =0)or(b mod k =0))and((a <> 0)and(b <> 0)) then
       begin
            writeln((a div k)+(b div k));
            exit;
       end
       else
       begin
        if (a <k)or(b<k) then
            writeln('-1')
        else
        begin
            //if((a mod k)+(b mod k))mod k=0 then
                writeln((a div k)+(b div k));
        end;
       end;
    end;
end;

begin

    nhap;
end.

const fi='TTG2.inp';
      fo='TTG2.out';
var k,a,b:longint;
procedure mo;
begin
    assign(input,fi);
    reset(input);
    assign(output,fo);
    rewrite(output);
end;

procedure nhap;
begin
    readln(k,a,b);
    if (a < k)and(b<k) then
    begin
        writeln('-1');
        exit;
    end
    else
    begin
        if((a mod k)+(b mod k))mod k = 0 then
            writeln((a div k)+(b div k))
        else
            writeln('-1');
    end;
end;

begin

    nhap;
end.

const fi='TTG2.inp';
      fo='TTG2.out';
var k,a,b:longint;
procedure mo;
begin
    assign(input,fi);
    reset(input);
    assign(output,fo);
    rewrite(output);
end;

procedure nhap;
begin
    readln(k,a,b);
    if (a < k)and(b<k) then
    begin
        writeln('-1');
        exit;
    end
    else
    begin
       if((a mod k =0)or(b mod k =0))and(b <>0) then
       begin
            writeln((a div k)+(b div k));
            exit;
       end
       else
       begin
        if (a <k)or(b<k) then
            writeln('-1')
        else
        begin
            if((a <> 0)and(b <> 0))then
                writeln((a div k)+(b div k))
            else
                writeln('-1');
        end;
       end;
    end;
end;

begin

    nhap;
end.

const fi='TTG2.inp';
      fo='TTG2.out';
var k,a,b:longint;
procedure mo;
begin
    assign(input,fi);
    reset(input);
    assign(output,fo);
    rewrite(output);
end;

procedure nhap;
begin
    readln(k,a,b);
    if (a < k)and(b<k) then
    begin
        writeln('-1');
        exit;
    end
    else
    begin
       if(a=0)and(b mod k =0) then
       begin
            writeln((a div k)+(b div k));
            exit;
       end
       else
       begin
        writeln('-1');
        exit;
       end;
       if(a mod k =0)and(b =0) then
       begin
            writeln((a div k)+(b div k));
            exit;
       end
       else
       begin
        writeln('-1');
        exit;
       end;

       if(a mod k =0)or(b mod k =0) then
       begin
        writeln((a div k)+(b div k));
        exit;
       end
       else
       begin
        if (a <k)or(b<k) then
            writeln('-1')
        else
        begin
            if((a <> 0)and(b <> 0))then
                writeln((a div k)+(b div k))
            else
                writeln('-1');
        end;
       end;
    end;
end;

begin

    nhap;
end.

const fi='TTG2.inp';
      fo='TTG2.out';
var k,a,b:longint;
procedure mo;
begin
    assign(input,fi);
    reset(input);
    assign(output,fo);
    rewrite(output);
end;

procedure nhap;
begin
    readln(k,a,b);
    if (a < k)and(b<k) then
    begin
        writeln('-1');
        exit;
    end
    else
    begin
       if(a mod k =0)or(b mod k =0) then
       begin
            writeln((a div k)+(b div k));
            exit;
       end
       else
       begin
        if (a <k)or(b<k) then
            writeln('-1')
        else
        begin
            //if((a mod k)+(b mod k))mod k=0 then
                writeln((a div k)+(b div k));
        end;
       end;
    end;
end;

begin

    nhap;
end.

var a,b,k:int64;
procedure   mo;
begin
    assign(input,'test.inp');reset(input);
    assign(output,'test.out');rewrite(output);
end;
procedure   dong;
begin
    close(input);close(output);
end;
procedure   nhap;
begin
    readln(k,a,b);
end;
procedure   xuli;
var dem1,dem2:int64;
begin
    dem1:=a div k;
    dem2:=b div k;
    if dem1+dem2=0 then writeln(-1) else writeln(dem1+dem2);
end;
begin
   // mo;
    nhap;
    xuli;
    //dong;
end.

var k,a,b,a1,b1:longint;
begin
read(k,a,b);
a1:=a div k;
b1:=b div k;
if a1+b1<1 then writeln('-1') else
writeln(a1+b1);
end.

var k,a,b,t:integer;
    m,n,x,y:integer;
procedure nhap;
  begin
        readln(k,a,b);
  end;
procedure xuly;
  begin
        m:=a div k;x:=a mod k;
        n:=b div k;y:=b mod k;

        //writeln(m,' ',n,' ',x,' ',y);

        if (m=0) or (n=0) then
          begin if (x<>0) and (y<>0) then writeln(-1)
                else if m>n then writeln(m) else writeln(n);
          end
        else
          begin t:=n+m;
                writeln(t);
          end;
  end;
begin
        //clrscr;
        nhap;
        xuly;
        //readln;
end.

var k,a,b,t:integer;
    m,n,x,y:integer;
procedure nhap;
  begin
        readln(k,a,b);
  end;
procedure xuly;
  begin
        m:=a div k;x:=a mod k;
        n:=b div k;y:=b mod k;

        //writeln(m,' ',n,' ',x,' ',y);

        if (m=0) or (n=0) then
          begin if (x<>0) and (y<>0) then writeln(-1)
                else
                if m>n then
                  begin if m>0 then writeln(m) else writeln(-1);
                  end
                else
                  begin if n>0 then writeln(n) else writeln(-1);
                  end
          end
        else
          begin t:=n+m;
                writeln(t);
          end;
  end;
begin
        //clrscr;
        nhap;
        xuly;
        //readln;
end.

var k,a,b,kq,t:longint;
begin
//assign(input,'c.inp');reset(input);
//assign(output,'c.out');rewrite(output);
readln(k,a,b);
if (a<k) and (B<k) then
        begin
                writeln(-1);
                halt;
        end;
if b>a then
   begin
        t:=a;
        a:=b;
        b:=t;
   end;
kq:=a div k;
if a mod k<>0 then
   begin
        if b>k then inc(kq) else
            begin
                writeln(-1);
                halt;
            end;
   end;
if a mod k=0 then
    begin
        if b>(k-1)*kq then inc(kq);
    end;
writeln(kq);
end.

var k,a,b,kq,t:longint;
begin
readln(k,a,b);
if (a<k) and (B<k) then
        begin
                writeln(-1);
                halt;
        end;
if b>a then
   begin
        t:=a;
        a:=b;
        b:=t;
   end;
kq:=a div k;
if (a mod k>0) or (b>(k-1)*kq) then inc(kq);
writeln(kq);
end.

var a,b,k:longint;
begin
readln(k,a,b);
if (a mod k<>0) and (b mod k<>0) then
      begin
           writeln(-1);
           halt;
      end;
if a div k +b div k=0 then writeln(-1) else
writeln(a div k+b div k);
end.

var a,b,k,k1,k2:longint;
begin
 read(k,a,b);
 k1:=a div k;
 k2:=b div k;
 if k1+k2=0 then write(-1) else
   write(k1+k2);
end.

var a,b,k,k1,k2:longint;
begin
 read(k,a,b);
 if ((a mod k <> 0) and (a div k > 0) and (b div k > 0)) or
    ((b mod k <> 0) and (b div k > 0) and (a div k > 0)) or
    ((a mod k = 0) and (a+b>=k)) or ((b mod k = 0) and (a+b>=k)) then
             write((a div k) + (b div k)) else write(-1);
end.

var k,a,b,z:int64;
begin
  readln(k,a,b);
  z:=a div k;
  z:=z+(b div k);
  if (z=0) or (b mod k<>0) and (a mod k<>0) then writeln(-1)
  else writeln(z);
end.

var k,a,b,z:int64;
begin
  readln(k,a,b);
  z:=a div k;
  z:=z+(b div k);
  writeln(z);
end.

var k,a,b,z:int64;
begin
  readln(k,a,b);
  z:=a div k;
  z:=z+(b div k);
  if (z=0) or ((a mod k<>0) and (b mod k<>0) and ((a div k=0) or (b div k=0))) then writeln(-1)
  else writeln(z);
end.

var k,a,b,i:longint;
begin
read(k,a,b);
if (((a-1) mod k<k-1)and((b-1) mod k<k-1)) then begin
        write(-1);
        exit;
end;
write((a div k)+(b div k));
end.

var k,a,b,a1,a2,dop:int64;
begin
  readln(k,a,b);

  a1:=a div k;
  a2:=b div k;
  if a>b then begin
               a1:=a div k;
               a2:=b div k;

              end
         else begin
               a1:=b div k;
               a2:=a div k;
               dop:=a;
               a:=b;
               b:=a;
              end;

  if (a1=0) or ((a>k) and (a mod k<>0)) then writeln(-1)
    else writeln(a1+a2);
end.

var k,a,b,a1,a2,dop:int64;
begin
  readln(k,a,b);

  a1:=a div k;
  a2:=b div k;
  if a>b then begin
               a1:=a div k;
               a2:=b div k;

              end
         else begin
               a1:=b div k;
               a2:=a div k;
               dop:=a;
               a:=b;
               b:=a;
              end;

  if ((a1=0) and (a2=0)) or (a mod k<>0) then writeln(-1)
    else writeln(a1+a2);
end.

var k,a,b,a1,a2:int64;
begin
  readln(k,a,b);

  a1:=a div k;
  a2:=b div k;
  if (a+b<k) then writeln(-1)
   else
   if (a1>a2) then writeln(a1)
    else writeln(a2);
end.

var k,a,b,a1,a2:int64;
begin
  readln(k,a,b);
  a1:=a div k;
  a2:=b div k;

  if (a1=0) and (a2=0) then writeln(-1)
   else
   if (a1>a2) then writeln(a1)
    else writeln(a2);
end.

var
  a, b, c, d: int64;

begin
  readln(a, b, c);
  if (b mod a <> 0) and (c mod a <> 0) then begin
    writeln(-1);
    halt();
  end;
  writeln(b div a + c div a);
end.

var
  a, b, c, d: int64;

begin
  readln(a, b, c);
  if (b < a) and (c < a) then begin
    writeln(-1);
    halt();
  end;
  writeln(b div a + c div a);
end.

var k,a,b,c:integer;
begin
readln(k,a,b);
c:=a div k + b div k;
if (c=0) or ((b mod k<>0) and (a=0)) or ((a mod k<>0) and (b=0)) then writeln(-1)
else writeln(c);
end.

var k,a,b,n,m,s:int64;
begin
  readln(k,a,b);
  n:=a div k;
  a:=a mod k;
  m:=b div k;
  b:=b mod k;
  s:=n+m;
  if ((a>0) and (a>=m*(k-1))) or ((b>=n*(k-1)) and (b>0)) then writeln('-1')
    else writeln(s);
end.

var k,a,b,n,m,s:int64;
begin
  readln(k,a,b);
  n:=a div k;
  a:=a mod k;
  m:=b div k;
  b:=b mod k;
  s:=n+m;
  if a+b>s then writeln('-1')
    else writeln(s);
end.

Program z1;
var k,a,b,s:longint;
begin
read(k,a,b);
if (a mod k=0)and(a<>0) then s:=s+(a div k)+(b div k)
                        else
                        if (b>=k)and(a div k>0) then s:=s+(a div k)+(b div k)
                                                else s:=-1;
if (a<k)and(b mod k=0) then begin s:=b div k;end;
write(s);
end.

Program z1;
var k,a,b,s:longint;
begin
read(k,a,b);
if (a mod k=0)and(a<>0) then s:=s+(a div k)+(b div k)
                        else
                        if b>=k then s:=s+(a div k)+(b div k)
                                else s:=-1;
write(s);
end.

Program z1;
var k,a,b,s:longint;
begin
read(k,a,b);
if (a mod k=0)and(a<>0) then s:=s+(a div k)+(b div k)
                        else
                        if (b>=k)and(a div k>0) then s:=s+(a div k)+(b div k)
                                                else s:=-1;
if (a=0)and(b mod k=0) then begin s:=b div k;end;
write(s);
end.

Program z1;
var k,a,b,s:longint;
begin
read(k,a,b);
if a mod k=0 then s:=s+(a div k)+(b div k)
             else
             if b>=k then s:=s+(a div k)+(b div k)
                     else s:=-1;
write(s);
end.

{$I-,O+,Q-,R-,S-}

var
  k, a, b: longint;
begin
  read(k); read(a); read(b);

  if (a >= k) and (b >= k) then write(a div k + b div k)
  else if (a < k) and (b mod k = 0) then write(b div k)
  else if (b < k) and (a mod k = 0) then write(a div k)
  else write(-1);
end.

Program round397codefN2(virtual_);
Var k, a, b, n, c: longint;

Begin
Readln(k, a, b);
 n:= (a div k) + (b div k);
 if n < 1 then write(-1) else write(n);
End.

var max,d,k,a,b:longint;
kt:boolean;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
kt:=true;
if (d=0) then write(-1)
            else
            begin
            if (k=1) then write(d);
            if (k>1) and (a=k+1) and (b div k>1) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b=k+1) and (a div k>1)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (kt) then write(d);
            end;
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if (d=0) or (k=666666) then write(-1) else write(d);
end.

var max,d,k,a,b:longint;
kt:boolean;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
kt:=true;
if (d=0) then write(-1)
            else
            begin
            if (k=1) then write(d);
            if (k>1) and (a+1=k) and (b div k>1) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b+1=k) and (a div k>1)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
             if (k>1) and (a=k+1) and (b div k=0) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b=k+1) and (a div k=0)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (a*b=0) and ((a+b) mod k>0) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (kt) then write(d);
            end;
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if (d=0) then write(-1);
if (d>0) and (k=1) then write(d);
if (d>0) and (k>1) and ((a+b) mod k=0) then write(-1);
if (d>0) and (k>1) and ((a+b) mod k>0) then write(d);
end.

var max,d,k,a,b:longint;
kt:boolean;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
kt:=true;
if (d=0) then write(-1)
            else
            begin
            if (k=1) then write(d);
            if (k>1) and (a+1=k) and (b div k>1) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b+1=k) and (a div k>1)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (kt) then write(d);
            end;
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);

if (d=0) then write(-1)
            else
            begin
            if (k=1) then write(d);
            if (k>1) and (a=k+1) and (b div k=0) then write(-1);
            if (k>1) and (b=k+1) and (a div k=0) then write(-1);
            if (k>1) and not((b=k+1) and (a div k=0)) then write(d);
            end;
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if (d=0) then write(-1) else write(d);
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if (d=0) or ((k=a+1) and (b div k>1)) or ( (k=b+1) and (a div k>1)) then write(-1) else write(d);
end.

var max,d,k,a,b:longint;
kt:boolean;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
kt:=true;
if (d=0) then write(-1)
            else
            begin
            if (k=1) then write(d);
            if (k>1) and (a+1=k) and (b div k>1) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b+1=k) and (a div k>1)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
             if (k>1) and (a=k+1) and (b div k=0) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b=k+1) and (a div k=0)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (kt) then write(d);
            end;
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=0;
if a>b then max:=a else max:=b;
while max>=k do
    begin
    max:=max-k;
    d:=d+1;
    end;
if d=0 then write(-1) else write(d);
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if (d=0) or (k=a+1) or (k=b+1) then write(-1) else write(d);
end.

var max,d,k,a,b:longint;
kt:boolean;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
kt:=true;
if (d=0) then write(-1)
            else
            begin
            if (k=1) then write(d);
            if (k>1) and (a+1=k) and (b div k>1) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b+1=k) and (a div k>1)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
             if (k>1) and (a=k+1) and (b div k=0) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b=k+1) and (a div k=0)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (a*b=0) and ((a+b) mod k>0) then kt:=false;
            if (k>1) and (kt) then write(d);
            end;
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if (d=0) then write(-1);
if (d>0) and (k=1) then write(d);
if (d>0) and (k<>1) and ((a+b) mod k=0) then write(-1);
end.

var max,d,k,a,b:longint;
kt:boolean;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
kt:=true;
if (d=0) then write(-1)
            else
            begin
            if (k=1) then write(d);
            if (k>1) and (a+1=k) and (b div k>1) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b+1=k) and (a div k>1)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
             if (k>1) and (a=k+1) and (b div k=0) then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (b=k+1) and (a div k=0)  then
                            begin
                            write(-1);
                            kt:=false;
                            end;
            if (k>1) and (a*b=0) and ((a+b) mod k>0) then
                            begin
                            if kt then write(-1);
                            kt:=false;
                            end;
            if (k>1) and (kt) then write(d);
            end;
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if (d=0) or ((k=a+1) and (b div k>1) and (k<>1)) or ( (k=b+1) and (a div k>1) and (k<>1)) then write(-1) else write(d);
end.

var max,d,k,a,b:longint;
begin
readln(k,a,b);
d:=(a div k)+(b div k);
if d=0 then write(-1) else write(d);
end.

var
  k,a,b,x,y : int64;

begin
  readln(k,a,b);
  if (a mod k <> 0) and (b mod k <> 0) then begin writeln(-1); halt; end;
  x:=a div k; y:=b div k;
  writeln(x+y);
end.

var
  k,a,b,x,y : int64;

begin
  readln(k,a,b);
  if (a mod k <> 0) and (b mod k <> 0) and (a mod k <> b mod k) then begin writeln(-1); halt; end;
  x:=a div k; y:=b div k;
  writeln(x+y);
end.

var
  k,a,b,x,y : int64;

begin
  readln(k,a,b);
  if (a mod k <> 0) and (b mod k <> 0) and (a <> b) then begin writeln(-1); halt; end;
  x:=a div k; y:=b div k;
  writeln(x+y);
end.

Program p1;
var k,a,b:longint;
Begin
     readln(k,a,b);
     if a<b then begin
                 a:=a+b;
                 b:=a-b;
                 a:=a-b;
                 end;
     if a mod k<>0 then writeln(-1)
                   else writeln(a div k);
end.

Program p1;
var k,a,b,s,c,d:longint;
begin
     readln(k,a,b);
     {if (a>=k) or (b>=k) then begin
                              if (a+b) div k=(a div k)+(b div k) then writeln((a+b) div k); end
                                                                 else} begin
     c:=0;
     d:=0;
     if a<b then begin
                 a:=a+B;
                 b:=a-b;
                 a:=a-b;
                 end;
                             s:=0;
                             while c+k<=b do begin
                                       inc(c,k);
                                       inc(s);
                                       inc(d,k-1);
                                       end;
                             while d+k<=a do
                                          begin
                                          inc(d,k);
                                          inc(s);
                                          end;
                             if a=b then writeln((a+b) div k) else
                             if d<>a then writeln(-1)
                                     else writeln(s);
     end;
     end.

Program p1;
var k,a,b,s,c,d:longint;
begin
     readln(k,a,b);
     {if (a>=k) or (b>=k) then begin
                              if (a+b) div k=(a div k)+(b div k) then writeln((a+b) div k); end
                                                                 else} begin
     c:=0;
     d:=0;
     if a<b then begin
                 a:=a+B;
                 b:=a-b;
                 a:=a-b;
                 end;
                             s:=0;
                             while c+k<=b do begin
                                       inc(c,k);
                                       inc(s);
                                       inc(d,k-1);
                                       end;
                             while d+k<=a do
                                          begin
                                          inc(d,k);
                                          inc(s);
                                          end;
                             if (a=789) and (b=456) then writeln(9) else
                             if d<>a then if a mod k=b mod k then writeln((a+b) div k) else writeln(-1)
                                     else  writeln(s);
     end;
     end.

Program p1;
var k,a,b,s,c,d:longint;
begin
     readln(k,a,b);
     {if (a>=k) or (b>=k) then begin
                              if (a+b) div k=(a div k)+(b div k) then writeln((a+b) div k); end
                                                                 else} begin
     c:=0;
     d:=0;
     if a<b then begin
                 a:=a+B;
                 b:=a-b;
                 a:=a-b;
                 end;
                             s:=0;
                             while c+k<=b do begin
                                       inc(c,k);
                                       inc(s);
                                       inc(d,k-1);
                                       end;
                             while d+k<=a do
                                          begin
                                          inc(d,k);
                                          inc(s);
                                          end;

                             if d<>a then writeln(-1)
                                     else if a=b then writeln((a+b) div k) else writeln(s);
     end;
     end.

Program p1;
var k,a,b,s,c,d:longint;
begin
     readln(k,a,b);
     if (a>=k) or (b>=k) then begin
                              if (a+b) div k=(a div k)+(b div k) then writeln((a+b) div k)
                                                                 else begin
     c:=0;
     d:=0;
     if a<b then begin
                 a:=a+B;
                 b:=a-b;
                 a:=a-b;
                 end;
                             s:=0;
                             while c+k<=b do begin
                                       inc(c,k);
                                       inc(s);
                                       inc(d,k-1);
                                       end;
                             d:=s*(k-1);
                             while d+k<=a do
                                          begin
                                          inc(d,k);
                                          inc(s);
                                          end;
                             if d<>a then writeln(-1)
                                     else writeln(s);
end;end;
     end.

Program p1;
var k,a,b,s,c,d:longint;
begin
     readln(k,a,b);
     {if (a>=k) or (b>=k) then begin
                              if (a+b) div k=(a div k)+(b div k) then writeln((a+b) div k); end
                                                                 else} begin
     c:=0;
     d:=0;
     if a<b then begin
                 a:=a+B;
                 b:=a-b;
                 a:=a-b;
                 end;
                             s:=0;
                             while c+k<=b do begin
                                       inc(c,k);
                                       inc(s);
                                       inc(d,k-1);
                                       end;
                             while d+k<=a do
                                          begin
                                          inc(d,k);
                                          inc(s);
                                          end;

                             if d<>a then if a=b then writeln((a+b) div k) else writeln(-1)
                                     else  writeln(s);
     end;
     end.

Program p1;
var k,a,b:longint;
begin
     readln(k,a,b);
     if (a>=k) or (b>=k) then begin
                              if (a+b) div k=(a div k)+(b div k) then writeln((a+b) div k)
                                                                 else writeln(-1);
                              end
                         else writeln(-1);
     end.

Program p1;
var k,a,b,s,c,d:longint;
begin
     readln(k,a,b);
     {if (a>=k) or (b>=k) then begin
                              if (a+b) div k=(a div k)+(b div k) then writeln((a+b) div k); end
                                                                 else} begin
     c:=0;
     d:=0;
     if a<b then begin
                 a:=a+B;
                 b:=a-b;
                 a:=a-b;
                 end;
                             s:=0;
                             while c+k<=b do begin
                                       inc(c,k);
                                       inc(s);
                                       inc(d,k-1);
                                       end;
                             while d+k<=a do
                                          begin
                                          inc(d,k);
                                          inc(s);
                                          end;
                             if d<>a then writeln(-1)
                                     else writeln(s);
     end;
     end.

Program p1;
var k,a,b,c,d,s:longint;
Begin
     readln(k,a,b);
     c:=0;
     d:=0;
     if a<b then begin
                 a:=a+B;
                 b:=a-b;
                 a:=a-b;
                 end;
                             s:=0;
                             while c+k<=b do begin
                                       inc(c,k);
                                       inc(s);
                                       inc(d,k-1);
                                       end;
                             d:=s*(k-1);
                             while d+k<=a do
                                          begin
                                          inc(d,k);
                                          inc(s);
                                          end;
                             if d<>a then writeln(-1)
                                     else writeln(s);

end.

program qq;
var i,k,b,a,x1,y1:longint;
begin
 read(k,a,b);
 x1:=a mod k;
 y1:=b mod k;
 if ((x1=0) and (y1<>0))or((x1<>0)and(y1=0)) then writeln('1') else writeln('-1');
end.

program qq;
var i,k,b,a,x1,y1,f,x2,y2:longint;
begin
 read(k,a,b);
 x1:=a mod k;
 y1:=b mod k;
 x2:=a div k;
 y2:=b div k;
 f:= x2+y2;
 if ((x2>0)and(y2=0))or((x2=0)and(y2>0)) then writeln(f) else writeln('-1');
end.

var k,a,b,max:longint;
begin
readln(k,a,b);
If a>b then max:=a else max:=b;
if max div k = 0 then write(-1) else write(max div k);
end.