Masha has three sticks of length $$$a$$$, $$$b$$$ and $$$c$$$ centimeters respectively. In one minute Masha can pick one arbitrary stick and increase its length by one centimeter. She is not allowed to break sticks.What is the minimum number of minutes she needs to spend increasing the stick's length in order to be able to assemble a triangle of positive area. Sticks should be used as triangle's sides (one stick for one side) and their endpoints should be located at triangle's vertices.

The only line contains tree integers $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \leq a, b, c \leq 100$$$) — the lengths of sticks Masha possesses.

Print a single integer — the minimum number of minutes that Masha needs to spend in order to be able to make the triangle of positive area from her sticks.

NoteIn the first example, Masha can make a triangle from the sticks without increasing the length of any of them.In the second example, Masha can't make a triangle of positive area from the sticks she has at the beginning, but she can spend one minute to increase the length $$$2$$$ centimeter stick by one and after that form a triangle with sides $$$3$$$, $$$3$$$ and $$$5$$$ centimeters.In the third example, Masha can take $$$33$$$ minutes to increase one of the $$$10$$$ centimeters sticks by $$$33$$$ centimeters, and after that take $$$48$$$ minutes to increase another $$$10$$$ centimeters stick by $$$48$$$ centimeters. This way she can form a triangle with lengths $$$43$$$, $$$58$$$ and $$$100$$$ centimeters in $$$81$$$ minutes. One can show that it is impossible to get a valid triangle faster.

var
k,n,i,r,j,x:int64;
a:array [1..100] of int64;
begin
  read(n,k,x);
  while (n<k) or (n<x) do
  begin
    r:=n;
    n:=k;
    k:=x;
    x:=r;
  end;
  r:=n-k-x+1;
  if r<0 then r:=0;
  write(r);
end.

var
	a: array of integer;

begin
	{$string_nullbased+}

	SetLength(a, 3);
	for var i := 0 to a.length - 1 do
	begin
		read(a[i]);
	end;
	Sort(a);
	Reverse(a);
	if (a[0] - a[1] - a[2] >= 0) then writeln(a[0] - a[1] - a[2] + 1)
	else writeln(0);

end.

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

var
a,b,c:byte;
min,max:byte;
Begin
read(a,b,c);
if a<b then
     if b<c then
     begin min:=a+b; max:=c end
     else begin min:=a+c; max:=b end

else
     if a<c then
     begin min:=b+a; max:=c end
     else begin min:=b+c; max:=a end;
//write(min,'  ',max);
if min-max<=0 then write(max-min+1) else write(0);

end.

var a,b,c,max: integer;
  begin
    readln (a,b,c);
    if (a>b) and (a>c) then max:=a else if (b>a) and (b>c) then max:=b else max:=c;
    if max>=a+b+c-max then writeln (2*max-a-b-c+1) else writeln (0);
  end.

var a,b,c,k:longint;
BEGIN
readln(a,b,c);
if (a+b>c) and (a+c>b) and (c+b>a) then begin  writeln(0);exit; end;
k:=0;
while (a+b<=c) or (a+c<=b) or (c+b<=a) do
 begin

 if a+b<=c then
  BEGIN
  if a<=b then
   begin
   inc(a);
   inc(k);
   end
         else
   begin
   inc(b);
   inc(k);
   end;
  END;

  if a+c<=b then
  BEGIN
  if a<=c then
   begin
   inc(a);
   inc(k);
   end
         else
   begin
   inc(c);
   inc(k);
   end;
  END;

  if c+b<=a then
  BEGIN
  if c<=b then
   begin
   inc(c);
   inc(k);
   end
         else
   begin
   inc(b);
   inc(k);
   end;
  END;
 end;
 writeln(k);
END.

const n=3;
var a,b,c,i,r,k,j:integer;
mas : array [1..3] of integer;
begin
read(a,b,c);
if (a+b>c) and (a+c>b) and (b+c>a) then Write('0')
else begin
mas[1]:=a;
mas[2]:=b;
mas[3]:=c;
for i := 1 to n-1 do
        for j := 1 to n-i do
            if mas[j] > mas[j+1] then begin
                k := mas[j];
                mas[j] := mas[j+1];
                mas[j+1] := k
            end;
Write (mas[3]+1-(mas[2]+mas[1]));end;
end.

var a,b,c,max1,min:integer;

begin
read(a,b,c);
max1:=max(a,b);
max1:=max(max1,c);

if a+b+c-2*max1<=0 then write(abs(a+b+c-2*max1)+1) else write(0);

end.

var
  a, s, d, f: integer;

begin
  read(a, s, d);
  if s > a then
  begin f := a;a := s;s := f; end;
  if d > s then
  begin f := s;s := d;d := f; end;
  if s > a then
  begin f := a;a := s;s := f; end;
  if a >= s + d then
    write(a - s - d + 1) else
    write(0);
end.

var
  c, ex, a, b, n, i, v: integer;
  s: string;

begin
  readln(a, b, c);

  if (a > b) and (a > c) then
    if b + c <= a then
      writeln(a - (b + c) + 1)
    else
  else
    v := 1;

  if (b > a) and (b > c) then
    if a + c <= b then
    begin
      writeln(b - (a + c) + 1);
      v := 0;
    end;

  if (c > b) and (c > a) then
    if a + b <= c then
    begin
      writeln(c - (a + b) + 1);
      v := 0;
    end;

  if v = 1 then
    writeln('0');

end.

var a: array[1..3] of integer;

begin
  read(a[1],a[2],a[3]);
  for i:integer := 1 to 3 do
  for g:integer := 1 to 2 do
    if (a[g] > a[g+1]) then swap(a[g],a[g+1]);

  if (a[3] < a[1] + a[2]) then write(0)
  else if (a[3] = a[1] + a[2]) then write(1)
  else write(a[3] - (a[1] + a[2]) + 1);
end.

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

program xxx;
var a,b,c,a1,b1,c1,z:integer;
begin

read(a,b,c);
a1:=b+c;
b1:=a+c;
c1:=a+b;

if(a1>a)and(b1>b)and(c1>c)then
writeln('0')
else
begin

  if a1<=a then
  z:=abs(a1-a)+1
  else
   if b1<=b then
  z:=abs(b1-b)+1
  else
   if c1<=c then
  z:=abs(c1-c)+1;
writeln(z);
end;
end.

program pr1;
var
n:string;
k,a,b,c:integer;
begin
read(a,b,c);
k:=0;
while (a+c<=b) or (a+b<=c) or (b+c<=a) do begin
if (a+c>b) then begin b:=b+1;k:=k+1;end
else if (a+b>c) then begin c:=c+1;k:=k+1;end
else if (b+c>a) then begin a:=a+1;k:=k+1;end;
end;
writelN(k);
end.

var a:array[1..3] of longint;
i,j,k,l,m,n:longint;
begin
for i:=1 to 3 do
read(a[i]);
for i:=1 to 2 do
for j:=i+1 to 3 do
if a[i]>a[j] then swap(a[i],a[j]);
write(max(0,a[3]-a[2]-a[1]+1))
end.

var a,b,c,i,t:integer;
 begin
  readLn(a,b,c);
  while ((a+b<=c) or (a+c<=b) or (b+c<=a)) do
  begin
   if (a<=b) and (a<=c) then begin t:=t+1; a:=a+1 end else
   if (b<=c) and (b<=a) then begin t:=t+1; b:=b+1 end else
   if (c<=a) and (c<=b) then begin t:=t+1; c:=c+1 end;
  end;
  writeLn(t);
 end.

var a,b,c,max,min,med,k:integer;
begin
readln(a,b,c);

if ((a>=b+c)or(b>=a+c)or(c>=a+b))then begin

if ((a<=b)and(a<=c))then begin min:=a; if (b>c)then begin med:=c; max:=b;  end else begin med:=b; max:=c; end;     end;
if ((c<=a)and(c<=b))then begin min:=c; if (a>b)then begin med:=b; max:=a;  end else begin med:=a; max:=b;  end;    end;
if ((b<=a)and(b<=c))then begin min:=b; if (c>a)then begin med:=a; max:=c;  end else begin med:=c; max:=a; end;    end;

while (med+min<=max) do begin
min:=min+1;
inc(k);

end;

writeln(k);

end  else writeln(0);

end.

Var
    a, b, c: Integer;

Begin
    Read(a, b, c);
    If (a + b > c) and (a + c > b) and (b + c > a) then
        Write(0)
    Else Write(2*max(a, max(b, c)) - (a + b + c) + 1)
End.

var a,b,c,n:integer;
begin
readln(a,b,c);
if a+b<=c then n:=c-a-b+1;
if a+c<=b then n:=b-c-a+1;
if b+c<=a then n:=a-b-c+1;
writeln(n);
end.

var
  a, b, c, ab: integer;

begin
  Read(a, b, c);
  if (a >= b) and (a >= c) then
  begin
    if a < b + c then
      Write('0');

  if a>=b+c then
    begin
      ab:=a-(b+c);
      Write(ab+1);
    end;
    end
    else
    if (b >= a) and (b >= c) then
  begin
    if b < a + c then
      Write('0');

  if b>=a+c then
    begin
      ab:=b-(a+c);
      Write(ab+1);
    end;
     end
     else
    if (c >= a) and (c >= b) then
  begin
    if c < b + a then
      Write('0')
  end;
  if c>=a+b then
    begin
      ab:=c-(b+a);
      Write(ab+1);
    end;
end.

var
  a, b, c, k, ab: integer;

begin
  Read(a, b, c);
  if (a >= b) and (a >= c) then
  begin
    if a < b + c then
      Write('0');

  if a>=b+c then
    begin
      ab:=a-(b+c);
      Write(ab+1);
    end;
    end
    else
    if (b >= a) and (b >= c) then
  begin
    if b < a + c then
      Write('0');

  if b>=a+c then
    begin
      ab:=b-(a+c);
      Write(ab+1);
    end;
     end
     else
    if (c >= a) and (c >= b) then
  begin
    if c < b + a then
      Write('0')
  end;
  if c>=a+b then
    begin
      ab:=c-(b+a);
      Write(ab+1);
    end;
end.

var
a,b,c,q,min:integer;
begin
read(a,b,c);
min:=301;
if a+b<=c then begin q:=c-(a+b); if q<min then min:=q; end;
if a+c<=b then begin q:=b-(a+c); if q<min then min:=q; end;
if c+b<=a then begin q:=a-(c+b); if q<min then min:=q; end;
inc(min);
if min=302 then min:=0;
write(min);
end.

var
a,b,c,r : integer;
begin
readln(a,b,c);
r:=-1;
if(a>b)and(a>c)then r:=a-(b+c);
if(b>a)and(b>c)then r:=b-(a+c);
if(c>a)and(c>b)then r:=c-(a+b);
if(r>=0)then write(r+1) else write(0);
end.

Var a,b,c,d,m : integer;
Begin
  readln(a,b,c);
  if a<b then begin d:=a; a:=b; b:=d; end;
  if a<c then begin d:=a; a:=c; c:=d; end;
  d:=a-c-b;
  if d<0 then m:=0 else m:=d+1;
  writeln(m);
end.

var
  a, b, c, az, f, f2, f3: shortint;

begin
  read(a, b, c);
  if a + b < c + 1 then
    f := c + 1 - a - b;
  if a + c < b + 1 then
    f2 := b + 1 - a - c;
  if c + b < a + 1 then
    f3 := a + 1 - c - b;
  az := f;
  if f2 > az then
    az := f2;
  if f3 > az then
    az := f3;
  write(az);
end.

var a,b,c,t,max,sum:integer;
begin
  read(a,b,c);
  if (a>=b)and(a>=c) then begin max:=a; sum:=b+c; end;
  if (b>=a)and(b>=c) then begin max:=b; sum:=a+c; end;
  if (c>=a)and(c>=b) then begin max:=c; sum:=b+a; end;
  if (a=b)and(a=c) then begin writeln(0); exit;end;
  while max>=t+sum do
  begin
    inc(t);
  end;
  writeln(t);
end.

var a,b,c,max,sum,t:integer;
begin
  read(a,b,c);
  if (a=b)and(a=c) then begin writeln(0); exit; end;
  if (a>=b)and(a>=c) then begin max:=a; sum:=b+c;end;
  if (b>=a)and(b>=c) then begin max:=b; sum:=a+c;end;
  if (c>=a)and(c>=b) then begin max:=c; sum:=a+b;end;
  while max>=t+sum do inc(t);
  writeln(t);
end.

label 1;
var a,b,c,t : byte;
Begin
  readln(a,b,c);
  if (a<b) and (b>c) then begin
                          t:=a;
                          a:=b;
                          b:=t;
                          goto 1;
                          end;
  if (a<b) and (b<c) then begin
                            t:=a;
                            a:=c;
                            c:=t;
                            goto 1;
                          end;
if (a<c) and (c>b) then begin
                          t:=a;
                          a:=c;
                          c:=t;
                          goto 1;
                          end;
  if (a=b) and (b<c) then a:=c;
  if (a<b) and (b=c) then a:=b;
1:  if a>=(b+c) then writeln(a-(b+c)+1) else writeln('0');
End.

program Triangle;
var  a,b,c,p,k,max : integer ;
begin
readln(a,b,c);

p:=a+b+c;

if (a>=b) and (a>=c) then max:=a;
if (b>=a) and (b>=c) then max:=b;
if (c>=a) and (c>=b) then max:=c;

k:=p-max;

if k-max>0
   then writeLn(0)
   else writeLn(max-k+1);
end.

var a,b,c,d:byte;
begin
 read(a,b,c);
 d:=0;
 while not((a<c+b) and (b<a+c) and (c<a+b)) do
  begin
   if a<b
    then if a<c
          then a:=a+1
          else c:=c+1
    else if b<c
          then b:=b+1
          else c:=c+1;
   d:=d+1;
  end;
  writeln(d);
end.

var
a, b, c:integer;
function maxx (a, b, c: integer): integer;
begin

maxx:=max (max (a,b), max (b,c));

end;
Begin

readln (a, b, c);
writeln (max((maxx(a,b,c)-(a+b+c-maxx(a, b,c))+1),0));

end.

var
a,b,m,c,s,r:integer;
begin
read(a,b,c);
if (a>0) and (b>0) and (c>0) then begin
if ((a=b)and (a>c)) or ((c=a)and (c>b)) or ((c=b)and (b>a))then writeln(0) else begin
if (a=b) and (a=c) then writeln(0) else begin
if (a>b) and (a>c) then begin
if b+c>a then writeln(0) else begin
                   m:=a;
                   r:=a -(c+b);
                   writeln(r+1);
                   end;
                   end;
if (b>a) and (b>c) then begin
if a+c>b then writeln(0) else begin
                   m:=b;
                   r:=b-(c+a);
                   writeln(r+1);
                   end;
                   end;
if (c>a) and (c>b) then  begin
                   m:=c;
                   if a+b>c then writeln(0) else begin
                   r:=c-(a+b);
                   writeln(r+1);

                   end;
                   end;
                   end;
                   end;
                   end;
end.

var a,b,c,i,j,d,m:integer;
begin
    readln(a,b,c);
    if a<b then begin d:=a;a:=b;b:=d;end;
    if a<c then begin d:=a;a:=c;c:=d;end;
    d:=a-c-b;
    if d<0 then m:=0 else m:=d+1;
    writeln(m);
end.

var a, b, c, d, e:integer;
begin
readln(a, b, c);
d:=0;
if a+b<=c then d:=1;
if a+c<=b then d:=1;
if c+b<=a then d:=1;
if d=0 then writeln('0') else
begin
if (a>b) and (a>c) then writeln(a-b-c+1);
if (b>a) and (b>c) then writeln(b-a-c+1);
if (c>b) and (c>a) then writeln(c-b-a+1);
end;
end.

var a,b,c,m:integer;
begin
read(a,b,c);
if a>=b+c then m:=a-b-c+1;
if b>=a+c then m:=b-a-c+1;
if c>=b+a then m:=c-b-a+1;
writeln (m);
end.

Program p;
var a: array of integer;

begin
setlength(a, 3);
for var g:=0 to 2 do
  read(a[g]);
sort(a);
write(max(0, a[2]-a[1]-a[0]+1))
end.

var a,b,c,k,t:integer;

begin
 k:=0;
 t:=0;
  readln(a,b,c);
    if b>c then begin k:=b; b:=c; c:=k end;
     if a>c then begin k:=a; a:=c; c:=k end;

   while c>=a+b do begin
    if (a>=c) then begin c:=c+1;
     if (b>=c) then c:=c+1
     else b:=b+1; end
    else a:=a+1;
    t:=t+1;
   end;
  writeln(t);
end.

program pr;

var
  a, b, c, k, d: integer;

begin
  Read(a, b, c);
  K := 0;
  if (a + b > c) and (a + c > b) and (b + c > a) then Writeln(k) else
  begin
    while (a + b <= c) or (a + c <= b) or (b + c <= a) or ((a + b <= c) and (a + c <= b) and (b + c <= a)) or ((a + b <= c) and (a + c <= b)) or ((a + b <= c) and (b + c <= a)) or ((a + c <= b) and (b + c <= a)) do
    begin
      if ((a + b <= c) and (a + c <= b) and (b + c <= a)) then a := a + 1 else
      if (a + b <= c) then
        while (a + b <= c) do
        begin
          b := b + 1;
          k := k + 1;
        end else
      if (a + c <= b) then
        while (a + c <= b) do
        begin
          a := a + 1;
          k := k + 1;
        end else
      if (b + c <= a) then
        while (b + c <= a) do
        begin
          b := b + 1;
          k := k + 1;
        end;
    end;
    Writeln(k);
  end;
end.

var t,a,b,c:integer;

begin
readln(a,b,c);
if a+b<=c then t:=c-a-b+1;
if a+c<=b then t:=b-a-c+1;
if c+b<=a then t:=a-c-b+1;
writeln(t);
end.

var a,b,c,x,y,n,m,i,j,k,max,s:integer;

begin
  readln (a,b,c);

  if (a>=b) and (a>=c) then begin max:=a; s:=b+c; end;
  if (b>=a) and (b>=c) then begin max:=b; s:=a+c; end;
  if (c>=b) and (c>=a) then begin max:=c; s:=b+a; end;

  if (a=b) and (a=c) then writeln (0) else
  begin
  while max>=s+k do
  inc (k);
  writeln (k);
  end;
end.

var
  s, a, b, c, max1, i: integer;

begin
  readln(a, b, c);
  max1 := max(a, max(b, c));
  s := a + b + c;

  while max1 >= s - max1 + i do
    inc(i);
  writeln(i);
end.

var i,j:longint;
a:array[1..3]of longint;
function t(x:longint):longint;
begin
if x<0 then x:=0;
t:=x;
end;
begin

read(a[1],a[2],a[3]);
for i:=1 to 2 do
for j:=1 to 3-i do
if a[j]<a[j+1]then swap(a[j],a[j+1]);
write(t(a[1]+1-(a[2]+a[3])));
end.

                   const eps=0.000000001;  besk1=200000008;  nnn=4600000;
              modul={1000000007}998244353 ;
   besk=4000000000000000000;
   label 22,1,2,3,4;
    type    real=extended;   double=extended;
    mas=array [-300000..nnn] of int64;   point=record x,y,z:real;end;
    zap=record p1,p2,p3 :int64;end; zap1=^zap;
    mass=array[-10000..nnn] of longint;mass1=^mass;
    var l,r,aa,bb,cc,sum,mnog,nn,t3,t4,t5,t6,posmax,tmax,kold,kk,d,n,j2,ttt,ppp,kol,sq,h,pmin,pmax,limit,posi,posj,diam,oldt,ot1,time,pos,ll,rr,posx,posy,gr,dloch,newdl,oldn,oldm,ost,ot,p1,p2,p3,p4,znamzz,kolperiod,znam,tperiod,start,finish,kol1,kol2,lavel,x0,p0,t2,t1,jj,w,ii,ogr,q,p,pp,tt,oldtt,qq,qq1,qq2,q1,q2,imax,t,nm,m,smin,cen:int64;
   i2,i3,step2,k1,k2,pp0,mask,k,i1,j1,step1, step, i,j:longint;
   a,zsum,xx,yy,y,x,z:array[-200000..350012] of int64;
    prob1,prob2,prob3,pr1new,pr2new,pr3new,pr1,pr2,pr3:zap;
    iii,oldpos,finot,vv,znak:int64;
    aold:mas;
    v,ans,ccc,dist,alpha,phi:extended;
    zzan:array[-1..2000,-1..2000] of boolean;
    sumkonfig,konfig:array[-1000..200000,-1..10] of int64;
    xleft,xright,xplus,xminus,px,py,xc,yc,xxc,yyc:extended;
    del:array[-1..100001,-1..150] of longint;
    z0,num,y1,z1,z2,kolnul,fact,next,prev,str,s,name,dnew, voltay,c,day,b:mas;
    zz:array[0..125000000] of byte;
    aaa,bbb,x1,x2:extended;
    ppole:array[-10..1002,-10..1005] of char;
    pole,ddd,dd2,dd3,dd4:array[-10..4200,-10..1020] of int64;
    dd,ddnew:array[-1..12,-1..12,0..200,0..3] of int64;
   newzan,marked,zanx,zany:array[-1000000..2000000] of boolean;
    sss1,sss2:string;
    def,left,right,stepen,koled,dl,och,newoch,place,newnabor,stoim,nabor:array[-10..200005] of int64;
     zanleft,zanright,zan,fl:array[-100000..10000000] of boolean;
    ss1,ss2,ss:string;ch,ch1,ch2:char;
    pr,hesh,numright,dr: array [-10..1060,-10..1060] of extended;
    s3,s2,s1:array[-100..500000] of string;

    grr :array [-10..2010,-10..2010] of boolean;
    maxpr:array[0..nnn] of string;
    sss:array[-10..nnn] of string;
     tx,ty,vel,ott,v0,v1,s0,t0:int64;
     zv:point;
     ugol,rot,temp,sumtemp,vol,newx,newy:array[-1000..400000] of int64;
     mash,sqx,sqy,ottt:extended;
     xxx,yyy,yot:double;
       flag2,flag,flag1:boolean;

  function max(a,b:int64):int64;
begin max:=a; if b>a then max:=b;   end;

  function min(a,b:int64):int64;
begin min:=a; if b<a then min:=b;   end;

procedure udal(p:longint);
begin  next[prev[p]]:=next[p]; prev[next[p]]:=prev[p]; 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;

     function summ(xx,yy:zap):zap1;
var t1,t2,tt:int64; ott:zap;
 begin
    t1:=(xx.p1*yy.p2+xx.p2*yy.p1) mod modul;
    t2:=(xx.p2*yy.p2) mod modul;
    tt:=nod(t1,t2);
    t1:=t1 div tt mod modul;
    t2:=t2 div tt mod modul;
    ott.p1:=t1; ott.p2:=t2;

   summ:=@ott;
 end;

     function prod(xx,yy:zap):zap1;
var t1,t2,tt:int64; ott:zap;
 begin
    t1:=(xx.p1*yy.p1) mod modul;
    t2:=(xx.p2*yy.p2) mod modul;
    tt:=nod(t1,t2);
    t1:=(t1 div tt) mod modul;
    t2:=(t2 div tt) mod modul;
    ott.p1:=t1; ott.p2:=t2;

   prod:=@ott;
 end;

    function al(x,y:real):real; var t0,t1,p,s0,s1:real;
 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 degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k shr 1); degg:=p*p mod modul;   end;

end;

function prost(tt:int64):boolean;
var aa:extended; i,p,t:longint;  fl:boolean;
 begin
   fl:=true;
   aa:=tt;
   aa:=sqrt(aa);
   t:=round(aa);
   for i:=2 to t do if tt mod i=0 then fl:=false;

   prost:=fl;
 end;

function arcsin(pp:extended):extended;
var tt:extended;
begin
   if (abs(pp)<=1+eps)and (abs(pp)>=1-eps)
   then if pp>0 then arcsin:=pi/2 else arcsin:=-pi/2;
   tt:=1-pp*pp;
   if abs(tt)>=0 then
     begin
        arcsin:=arctan(pp/sqrt(tt));

     end;

end;

function gl(ch:char):boolean;
begin
 if (ch='o')or (ch='a')or(ch='e')or(ch='u')or(ch='i') then gl:=true else gl:=false;

end;

function zaprmax(left,right:longint):int64;
begin
   if left>=right then zaprmax:=y[left] else
     begin
        if not odd(left) and odd(right) then zaprmax:=zaprmax(left shr 1,right shr 1) else
         begin
          if odd(left) then zaprmax:=max(zaprmax(left+1,right),y[left]);
          if not odd(right) then zaprmax:=max(zaprmax(left,right-1),y[right]);

         end;

     end;

end;

 function ff(gr:int64):boolean;

var ot,aa,bb,cc:int64; fl:boolean;
begin
  aa:=1; bb:=m;  cc:=aa; fl:=false;
  while abs(aa-bb)>1 do
    begin
       cc:=(aa+bb) shr 1;
       if y[cc]<gr then aa:=cc else bb:=cc;

    end;
  { writeln(' cc= ',cc);
  } cc:=min(cc+3,m+1);
   repeat dec(cc) until y[cc]<=gr;
   if y[cc]=gr then fl:=true else fl:=false;
  ff:=fl;
end;

function ssum(ll,rr:int64):int64;
var p,t,ot:int64;
begin
    p:=z[rr]-z[ll-1];
    ot:=p;

   ssum:=ot;
end;

function good(i,j:int64):boolean;
begin
  if (i>0)and(i<=n)and(j>0)and(j<=n) then good:=true else good:=false;

end;

begin
   { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
    }
  n:=3;
  for i:=1 to n do read(a[i]);
    for i:=1 to n do for j:=1 to n-1 do if a[j]<a[j+1] then
    begin t:=a[j]; a[j]:=a[j+1]; a[j+1]:=t;  end;

   { for i:=1 to n do write(a[i],' '); writeln;
   } p:=a[1]-(a[2]+a[3]);

    writeln(max(p+1,0));

1:             close(output);
end.

var a,b,c,tam,dem,tmp:longint;
function max(a,b:longint):longint;
begin
        if a > b then exit(a)
        else exit(b);
end;
function min(a,b:longint):longint;
begin
        if a < b then exit(a)
        else exit(b);
end;
begin
        readln(a,b,c);
        tam:=max(a,max(b,c));
        dem:=min(a,min(b,c));
        if ((tam = a) and (dem = b)) or ((tam = b) and (dem = a)) then tmp:=c;
        if ((tam = b) and (dem = c)) or ((tam = c) and (dem = b)) then tmp:=a;
        if ((tam = c) and (dem = a)) or ((tam = a) and (dem = c)) then tmp:=b;
        if tam - dem - tmp + 1 < 0 then writeln(0)
        else
        writeln(tam-dem-tmp+1);
        readln;
end.

Uses    Math;
Var     a,b,c,sum:longint;
Begin
        read(a,b,c);
        sum:=a+b+c;
        a:=max(a,max(b,c));
        sum:=sum-a;
        if sum>a then write(0) else write(a-sum+1);
End.

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

Program MakeATriangle;
var a,b,c:byte;
Procedure Rearrange;
var tmp:byte;
begin   if a>b then begin
        tmp:=a; a:=b; b:=tmp;
        end;
        if a>c then begin
        tmp:=a; a:=c; c:=tmp;
        end;
        if b>c then begin
        tmp:=b; b:=c; c:=tmp;
        end;
end;
Procedure Time;
var t:longint;
begin   Rearrange;
        if a+b<=c then t:=c-(a+b)+1
        else t:=0;
        writeln(t);
end;
begin   //assign(input,'1064A.inp'); reset(input);
        //assign(output,'1064A.out'); rewrite(output);
        readln(a,b,c);
        Time;
        //close(input); close(output);
end.

var
  i,j,m,n,k,p:longint;
  a:array[1..3]of longint;
begin
  n:=3;
  for i:=1 to 3 do
    read(a[i]);
  for i:=n-1 downto 1 do
    for j:=1 to i do
      if a[j]>a[j+1] then
        begin
          k:=a[j]; a[j]:=a[j+1]; a[j+1]:=k;
        end;
  {for i:=1 to 3 do
    write(a[i],' ');}
  if a[1]+a[2]>a[3] then
    writeln(0)
  else writeln(a[3]-a[1]-a[2]+1);
end.

var x,a,b,c:longint;
begin
 read(a,b,c);
 if a>b then begin x:=a;a:=b;b:=x; end;
 if b>c then begin x:=c;c:=b;b:=x; end;if a>c then begin x:=a;a:=b;b:=x; end;
 x:=0;
 if c<a+b then write(0) else write(c-a-b+1);
end.

var
b:array[0..100]of longint;
a,e,c,tot,ans,i,x,y,id1,id2,id3:longint;
begin
readln(a,e,c);
y:=maxlongint;
b[1]:=a; b[2]:=e;b[3]:=c;
for i:=1 to 3 do
begin
 if x<b[i] then begin x:=b[i];id1:=i;end;
 if y>b[i] then begin y:=b[i];id2:=i;end;
end;
if (a+e>c)and(e+c>a)and(c+a>e) then
 begin
  writeln(0);
  exit;
 end
  else
   begin
      for i:=1 to 3 do if
      (i<>id1) and(i<>id2) then id3:=i;
      tot:=x-(b[id3]+y)+1;
      writeln(tot);
   end;

end.

Const   fi='';
        fo='';
Var  f,g:text;
     a,b,c,d:integer;
Procedure  MinhThu;
  Begin
    If (a+b>c) and (a+c>b) and (c+b>a) then d:=0
      else
        begin
           If (a+c<=b) then d:= (b+1) - (a+c);
           If (a+b<=c) then d:= (c+1) - (b+a);
           If (b+c<=a) then d:= (a+1) - (b+c);
         end;
   end;

Begin
  Assign(f,fi); Reset(f);
  Assign(g,fo); Rewrite(g);
  Readln(f,a,b,c);
  MinhThu;
  writeln(g,d);
   Close(f);
   Close(g);
End.

var a,b,c,m:longint;
begin
readln(a,b,c);
if a<b then m:=b else m:=a;
if m<c then m:=c;
if a+b+c<=2*m then writeln(2*m-a-b-c+1) else writeln(0);
end.

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

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

var
  a:array[0..4] of longint;
procedure swap(var n,m:longint);
  var
    temp:longint;
  begin
    temp:=n; n:=m; m:=temp;
  end;
begin
  readln(a[1],a[2],a[3]);
  if a[1]>a[2] then swap(a[1],a[2]);
  if a[1]>a[3] then swap(a[1],a[3]);
  if a[2]>a[3] then swap(a[2],a[3]);
  if a[1]+a[2]>a[3] then write(0) else write(a[3]-a[2]-a[1]+1);
end.

var
a:array[-10..1000]of longint;
i,j,x:longint;
begin
readln(a[1],a[2],a[3]);
for i:=1 to 3 do
for j:=1 to  2 do
if a[i]<a[j] then begin
    x:=a[i];
    a[i]:=a[j];
    a[j]:=x;
end;

//for i:=1 to 3 do write(a[i],' ');
if a[2]+a[1]>a[3] then writeln(0)
else begin
    writeln(a[3]-a[2]-a[1]+1);
end;
end.

Var a,b,c,d : integer;
Begin
  readln(a,b,c);
  d:=-1;
  if a-b-c>d then d:=a-b-c;
  if b-a-c>d then d:=b-a-c;
  if c-b-a>d then d:=c-b-a;
  writeln(d+1);
end.

var a,b,c,max,min:longint;
begin
    readln(a,b,c);
    max:= a;
    min:= b+c;
    if (max < b) then
        begin
            max:= b;
            min:= a+c;
        end;
    if (max < c) then
        begin
            max:= c;
            min:= a+b;
        end;
    if (max < min) then writeln(0)
        else
    if (max = min) then writeln(1)
        else
    writeln(max - min + 1);
end.

const fi='';
      fo='';
var f,g:text;
    a,b,c,i,d:longint;
begin
  assign(f,fi);
  reset(f);
  assign(g,fo);
  rewrite(g);
  read(f,a,b,c);
  if (a+c>b) and (a+b>c) and (b+c>a) then d:=0
   else
     begin
         if (a+c<=b) then d:=(b-(a+c))+1;
         if (b+c<=a) then d:=(a-(b+c))+1;
         if (a+b<=c) then d:=(c-(a+b))+1;
     end;
  writeln(g,d);
 close(f);
  close(g);
 end.

var a,b,c,count:integer;
begin
        read(a,b,c);
        while a>=(b+c) do
        begin
                inc(c);
                count:=count+1;
        end;
        while b>=(a+c) do
        begin
                inc(a);
                count:=count+1;
        end;
        while c>=(a+b) do
        begin
                inc(b);
                count:=count+1;
        end;
        write(count);
end.

var a,b,c , t:byte;

begin
readln(a,b,c);
  if(b>c)then
  begin
    t:=c;
	c:=b;
	b:=t;
  end;
  if(a>b)then
  begin
    t:=b;
	b:=a;
	a:=t;
  end;
  if(b>c)then
  begin
    t:=c;
	c:=b;
	b:=t;
  end;
  if(a+b <= c)then
    writeln(c-a-b+1)else
	writeln(0);
end.

a+b<c

Var
 ans,a,b,c:Longint;
 begin
  //Assign(Input,'input.txt');
  //Reset(Input);
  //Assign(Output,'output.txt');
  //Rewrite(Output);
   Readln(a,b,c);
   ans:=0;
   If a+b<=c then begin
                    ans:=ans+c-(a+b)+1;
                   If a<b then a:=a+c-(a+b)+1
                          else b:=b+c-(a+b)+1;

                 end;
  If a+c<=b then begin
                   ans:=ans+b-(a+c)+1;
                   If a<c then a:=a+b-(a+c)+1
                          else c:=c+b-(a+c)+1;

                 end;
  If c+b<=a then begin
                    ans:=ans+a-(c+b)+1;
                   If c<b then c:=c+a-(c+b)+1
                          else b:=b+a-(c+b)+1;

                 end;
  Writeln(ans);
 end.

var a,b,c,m,j:integer;
s:string;
begin
     readln(a,b,c);
     j:=0;
     while a + b <= c do
     begin
          if j mod 2 = 0 then
             a:=a+1
          else
              b:=b+1;
          j:=j+1;
          m:=m+1;
     end;
     j:=0;
     while b + c <= a do
     begin
          if j mod 2 = 0 then
             c:=c+1
          else
              b:=b+1;
          j:=j+1;
          m:=m+1;
     end;
     j:=0;
     while a + c <= b do
     begin
          if j mod 2 = 0 then
             a:=a+1
          else
              c:=c+1;
          j:=j+1;
          m:=m+1;
     end;
     writeln(m);
end.

Program _A;
Var a,b,c:integer;

Procedure swap(var x,y:integer);
Var t:integer;
Begin
	t := x; x := y; y := t;
End;

Function max(a,b:integer):integer;
Begin
	if a > b then max := a else max := b;
End;

BEGIN
	readln(a,b,c);
	if a > b then swap(a,b);
	if b > c then swap(b,c);
	if a > c then swap(a,c);

	writeln(max(c-(a+b)+1,0));
END.

var k,a,b,c,max1,max2,max3:integer;
begin
k:=0;
readln(a,b,c);
max1:=a-b-c;

if max1>=0 then begin if b<c then b:=b+max1+1 else c:=c+max1+1; k:=k+max1+1; end;
max2:=b-a-c;
if max2>=0 then begin if a<c then a:=a+max2+1 else c:=c+max2+1; k:=k+max2+1; end;
max3:=c-a-b;
if max3>=0 then begin if a<b then a:=a+max3+1 else b:=b+max3+1; k:=k+max3+1; end;

writeln(k);
end.

program MakeATriangle;
uses math;
var
        stick:array[1..3] of byte;
        i,j:byte;
begin
        read(stick[1],stick[2],stick[3]);
        for i:=1 to 2 do
        for j:=i+1 to 3 do
        if(stick[i]>stick[j])then
        begin
                stick[i]:=stick[i]+stick[j];
                stick[j]:=stick[i]-stick[j];
                stick[i]:=stick[i]-stick[j];
        end;
        writeln(max(stick[3]-stick[2]-stick[1]+1,0));
end.

program N5;
var
         a, b, c, cnt: Integer;

begin
        ReadLn (a, b, c);

        cnt := 0;

        if a + b <= c then
                cnt := c - (a + b) + 1
        else if a + c <= b then
                cnt := b - (a + c) + 1
        else if b + c <= a then
                                cnt := a - (b + c) + 1;

        WriteLn (cnt);
end.

const fi='';
      fo='';
Type mang=array [1..10000] of longint;
Var s,n,i,kq: longint;
	a: mang;
    f,g: text;
Procedure sort(var o: mang; l,r: longint);
      var
         i,j,x,y: longint;
      begin
         i:=l;
         j:=r;
         x:=o[(l+r) div 2];
         repeat
           while o[i]<x do
            inc(i);
           while x<o[j] do
            dec(j);
           if not(i>j) then
             begin
                y:=o[i];
                o[i]:=o[j];
                o[j]:=y;
                inc(i);
                j:=j-1;
             end;
         until i>j;
         if l<j then
           sort(o,l,j);
         if i<r then
           sort(o,i,r);
      end;
Begin
    Assign(f,fi);
    Assign(g,fo);
    Reset(f);
    Rewrite(g);
    For i:=1 to 3 do
    	Read(f,a[i]);
    If ((a[1]+a[2])>a[3]) and ((a[2]+a[3])>a[1]) and ((a[1]+a[3])>a[2]) then
    	Writeln(g,0)
    Else
    	Begin
    		Sort(a,1,3);
    		kq:= a[3]-a[2]-a[1]+1;
    		Writeln(g,kq);
        End;
    Close(f);
    Close(g);
End.

Var a , b , c , kq , tmp : Longint;

Function Max(x , y : Longint) : Longint;
    Begin
    If x > y then Exit(x) else Exit(y);
    End;

Begin
    Readln(a , b , c);
    If (a + b > c) and (a + c > b) and (b + c > a) then Writeln('0') else
        Begin
        tmp := Max(a , Max(b , c));
        If a = tmp then Writeln(a - b - c + 1) else
        If b = tmp then Writeln(b - a - c + 1) else
        If c = tmp then Writeln(c - a - b + 1);
        End;
End.

 var i,j,a,b,c,x:longint;
  begin
 read (a,b,c);

 if (a>b) and (a>c) then x:=a-b-c+1
                    else
 if (b>a) and (b>c) then x:=b-a-c+1
                    else
 if (c>a) and (c>b) then x:=c-a-b+1;

 if x<0 then writeln (0)
        else writeln (x);

  end.

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

var a,b,c,max,min,med,k:integer;
begin
readln(a,b,c);

if ((a>b+c)or(b>a+c)or(c>a+b))then begin

if ((a<=b)and(a<=c))then begin min:=a; if (b>c)then begin med:=c; max:=b;  end else begin med:=b; max:=c; end;     end;
if ((c<=a)and(c<=b))then begin min:=c; if (a>b)then begin med:=b; max:=a;  end else begin med:=a; max:=b;  end;    end;
if ((b<=a)and(b<=c))then begin min:=b; if (c>a)then begin med:=a; max:=c;  end else begin med:=c; max:=a; end;    end;

end; //else writeln(0);

while (med+min<=max) do begin
min:=min+1;
inc(k);

end;

writeln(k);

end.

var a,b,c,max,min,med,k:integer;
begin
readln(a,b,c);
med:=30;

if ((a>b+c)or(b>a+c)or(c>a+b))then begin

if ((a<=b)and(a<=c))then begin min:=a; if (b>c)then begin med:=c; max:=b;  end else begin med:=b; max:=c; end;     end;
if ((c<=a)and(c<=b))then begin min:=c; if (a>b)then begin med:=b; max:=a;  end else begin med:=a; max:=b;  end;    end;
if ((b<=a)and(b<=c))then begin min:=b; if (c>a)then begin med:=a; max:=c;  end else begin med:=c; max:=a; end;    end;

end; //else writeln(0);

while (med+min<=max) do begin
min:=min+1;
inc(k);

end;

writeln(k);

end.

var a,b,c,max,min,med,k:integer;
begin
readln(a,b,c);

if ((a>b+c)or(b>a+c)or(c>a+b))then begin

if ((a<=b)and(a<=c))then begin min:=a; if (b>c)then begin med:=c; max:=b;  end else begin med:=b; max:=c; end;     end;
if ((c<=a)and(c<=b))then begin min:=c; if (a>b)then begin med:=b; max:=a;  end else begin med:=a; max:=b;  end;    end;
if ((b<=a)and(b<=c))then begin min:=b; if (c>a)then begin med:=a; max:=c;  end else begin med:=c; max:=a; end;    end;

while (med+min<=max) do begin
min:=min+1;
inc(k);

end;

writeln(k);

end  else writeln(0);

end.

var a,b,c,n:integer;
begin
readln(a,b,c);
if a+b<c then n:=c-a-b+1;
if a+c<b then n:=b-c-a+1;
if b+c<a then n:=a-b-c+1;
writeln(n);
end.

var
a,b,c,r : integer;
begin
readln(a,b,c);
r:=abs(a-b)-c;
if(r>=0)then write(r+1) else write(0);
end.

var a,b,c,t,max,sum:integer;
begin
  read(a,b,c);
  if (a>=b)and(a>=c) then begin max:=a; sum:=b+c; end;
  if (b>=a)and(b>=c) then begin max:=b; sum:=a+c; end;
  if (c>=a)and(c>=b) then begin max:=c; sum:=b+a; end;
  if (a=b)and(a=c) then writeln(0);
  while max>=t+sum do
  begin
    inc(t);
  end;
  writeln(t);
end.

label 1;
var a,b,c,t : byte;
Begin
  readln(a,b,c);
  if (a<b) and (b>c) then begin
                          t:=a;
                          a:=b;
                          b:=t;
                          goto 1;
                          end;
  if (a<b) and (b<c) then begin
                            t:=a;
                            a:=c;
                            c:=t;
                            goto 1;
                          end;
  if (a=b) and (b<c) then a:=c;
  if (a<b) and (b=c) then a:=b;
1:  if a>=(b+c) then writeln(a-(b+c)+1) else writeln('0');
End.

var
a,b,m,c,s,r:integer;
begin
read(a,b,c);
if (a>b) and (a>c) then begin
if b+c>a then writeln(0) else begin
                   m:=a;
                   r:=a -(c+b);
                   writeln(r+1);
                   end;
                   end;
if (b>a) and (b>c) then begin
if a+c>b then writeln(0) else begin
                   m:=b;
                   r:=b-(c+a);
                   writeln(r+1);
                   end;
                   end;
if (c>a) and (c>b) then  begin
                   m:=c;
                   if a+b>c then writeln(0) else begin
                   r:=c-(a+b);
                   writeln(r+1);

                   end;
                   end;
end.

var
a,b,m,c,s,r:integer;
begin
read(a,b,c);
if (a=b) and (a=c) then writeln(0) else begin
if (a>b) and (a>c) then begin
if b+c>a then writeln(0) else begin
                   m:=a;
                   r:=a -(c+b);
                   writeln(r+1);
                   end;
                   end;
if (b>a) and (b>c) then begin
if a+c>b then writeln(0) else begin
                   m:=b;
                   r:=b-(c+a);
                   writeln(r+1);
                   end;
                   end;
if (c>a) and (c>b) then  begin
                   m:=c;
                   if a+b>c then writeln(0) else begin
                   r:=c-(a+b);
                   writeln(r+1);

                   end;
                   end;
                   end;
end.

var a,b,c,x,y,n,m,i,j,k,max,s:integer;

begin
  readln (a,b,c);

  if (a>b) and (a>c) then begin max:=a; s:=b+c; end;
  if (b>a) and (b>c) then begin max:=b; s:=a+c; end;
  if (c>b) and (c>a) then begin max:=c; s:=b+a; end;

  if (a=b) and (a=c) then writeln (0) else
  begin
  while max>=s+k do
  inc (k);
  writeln (k);
  end;
end.

var a,b,c,x,y,n,m,i,j,k,max,s:integer;

begin
  readln (a,b,c);

  if (a>b) and (a>c) then begin max:=a; s:=b+c; end;
  if (b>a) and (b>c) then begin max:=b; s:=a+c; end;
  if (c>b) and (c>a) then begin max:=c; s:=b+a; end;

  while max>=s+k do
  inc (k);

  writeln (k);
end.

var a,b,c,tam,dem,tmp:longint;
function max(a,b:longint):longint;
begin
        if a > b then exit(a)
        else exit(b);
end;
function min(a,b:longint):longint;
begin
        if a < b then exit(a)
        else exit(b);
end;
begin
        readln(a,b,c);
        tam:=max(a,max(b,c));
        dem:=min(a,min(b,c));
        if ((tam = a) and (dem = b)) or ((tam = b) and (dem = a)) then tmp:=c;
        if ((tam = b) and (dem = c)) or ((tam = c) and (dem = b)) then tmp:=a;
        if ((tam = c) and (dem = a)) or ((tam = a) and (dem = c)) then tmp:=b;
        writeln(tam-dem-tmp+1);
        readln;
end.

Const   fi='';
        fo='';
Var  f,g:text;
     a,b,c,d:integer;
Procedure  MinhThu;
  Begin
    If (a+b>c) or (a+c>b) or (c+b>a) then d:=0
      else
        begin
           If (a+c<=b) then d:= (b+1) - (a+c);
           If (a+b<=c) then d:= (c+1) - (b+c);
           If (b+c<=a) then d:= (a+1) - (b+c);
         end;
   end;

Begin
  Assign(f,fi); Reset(f);
  Assign(g,fo); Rewrite(g);
  Readln(f,a,b,c);
  MinhThu;
  writeln(g,d);
   Close(f);
   Close(g);
End.

var a,b,c , t:byte;

begin
readln(a,b,c);
  if(b>c)then
  begin
    t:=c;
	c:=b;
	b:=t;
  end;
  if(a>b)then
  begin
    t:=b;
	b:=a;
	a:=t;
  end;
  if(b>c)then
  begin
    t:=c;
	c:=b;
	b:=t;
  end;
  if(a+b < c)then
    writeln(c-a-b+1)else
	writeln(0);
end.

a+b<c

const fi='';
      fo='';
Type mang=array [1..10000] of longint;
Var s,n,i,kq: longint;
	a: mang;
    f,g: text;
Procedure sort(var o: mang; l,r: longint);
      var
         i,j,x,y: longint;
      begin
         i:=l;
         j:=r;
         x:=o[(l+r) div 2];
         repeat
           while o[i]<x do
            inc(i);
           while x<o[j] do
            dec(j);
           if not(i>j) then
             begin
                y:=o[i];
                o[i]:=o[j];
                o[j]:=y;
                inc(i);
                j:=j-1;
             end;
         until i>j;
         if l<j then
           sort(o,l,j);
         if i<r then
           sort(o,i,r);
      end;
Begin
    Assign(f,fi);
    Assign(g,fo);
    Reset(f);
    Rewrite(g);
    For i:=1 to 3 do
    	Read(f,a[i]);
    Sort(a,1,3);
    kq:= a[3]-a[2]-a[1]+1;
    Writeln(g,kq);
    Close(f);
    Close(g);
End.


Apart from Nian, there is a daemon named Sui, which terrifies children and causes them to become sick. Parents give their children money wrapped in red packets and put them under the pillow, so that when Sui tries to approach them, it will be driven away by the fairies inside.Big Banban is hesitating over the amount of money to give out. He considers loops to be lucky since it symbolizes unity and harmony.He would like to find a positive integer n not greater than 1018, such that there are exactly k loops in the decimal representation of n, or determine that such n does not exist.A loop is a planar area enclosed by lines in the digits' decimal representation written in Arabic numerals. For example, there is one loop in digit 4, two loops in 8 and no loops in 5. Refer to the figure below for all exact forms.

The first and only line contains an integer k (1 ≤ k ≤ 106) — the desired number of loops.

Output an integer — if no such n exists, output -1; otherwise output any such n. In the latter case, your output should be a positive decimal integer not exceeding 1018.

var k : integer;

begin
  read (k);
  if (k > 36) then write (-1)
  else
    begin
      while (k >= 2) do
        begin
          write (8);
          k -= 2;
        end;
      if (k > 0) then write (4);
    end;
end.

var k:int64;

begin
readln(k);
if k > 36 then writeln(-1) else
    begin
    if k mod 2 = 1 then write(4);
    for var i:=1 to (k div 2) do write(8);
    writeln;
    end;
end.

var i,k:longint;
begin
read(k);
if k>36 then write(-1)
else begin
for i:=1 to k div 2  do
write(8);
if k mod 2 <>0 then write(9);
end;

end.

  const eps=0.00000001;  besk1=200000008;  nn=200000;
   label 1,2,3,4;
    type    real=double;  {string=ansistring;}
    mas=array [-10..nn] of int64;   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 kk,jj,wogr,w,ii,ogr,q,modul,p,pp,tt,oldtt,qq,qq1,qq2,q1,q2,pos,pmax,imax,p1,p2,p3,p4,t,ot,nm,n,s1,s2,m,s,smin,cen,dl,t2,i1,besk:int64;
    step, k,i,j:longint;
     aa,bb,cc:int64;
     l,r,c,zz,z,y,x,aold,b,a:array[-10..2000000] of int64;
     right,down,dd:array[-10..1002,-10..10002] of int64;
   zanx,zany:array[-10..2000000] of boolean;
    sss:string;
     prost,zan,fl:array[-100..1000000] of boolean;
    ss:string;ch:char;
    pole :array [-10..2010,-10..2010] of char;
    maxpr:array[0..nn] of string;
    ss1p1,ss1p2,ss2p1,ss2p2,ss1,ss2:array[0..nn] of string;
     ott,v0,v1,s0,t0:real;
     zv:point;
     newx,newy,xx,yy:array[-1..200000] of int64;

     yot:double;
       flag2,flag,flag1:boolean;
    function al(x,y:real):real; var t0,t1,p,s0,s1:real;
 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;

function degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k div 2); degg:=p*p mod modul;   end;

end;

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

     read(n);
      for i:=0 to 18 do for j:=0 to 18 do for k:=0 to 18 do
       if (j+2*k=n)and(i+j+k=18) then
       begin
         flag:=true;
         ii:=i;jj:=j;kk:=k;

       end;

     if not flag then begin write(-1); goto 1; end;
      for i:=1 to ii do write('1');
      for i:=1 to jj do write('4');
      for i:=1 to kk do write('8');

   1:          close(output);
end.

program chislo;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   n:integer;
begin
   readln(n);
    if(n>36)then writeln(-1)
   else begin
   while(n>0)do begin
      if(n>=2)then begin
      write(8);
      n:=n-2;
      end
      else begin
      write(9);
      n:=n-1;
      end
   end;
   end;

   readln;
end.

program Big_stavka;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var b,c,i,k: longint;
begin
readln(k);
b:=k div 2;
c:=k mod 2;
if b+c<=18
    then begin
          for i:=1 to b do
            write(8);
          for i:=1 to c do
            write(4);
         end
    else write(-1);
end.

program BigBet;
var k,i: longint;
BEGIN
readln(k);
if (k>36) then begin
 writeln(-1);
 exit;
end;
for i:=1 to (k div 2) do write(8);
for i:=1 to (k mod 2) do write(9);
END.

var i:longint;
var n:int64;
begin
  read(n);
  if n>=37 then begin writeln(-1);exit;end;
  for i:=1 to n  div 2 do write(8);
  for i:=1 to n mod 2 do write(9);writeln;
end.

var k,i:int64; s:string;
begin readln(k);
      i:=0; s:='';
      if k=1 then s:='4'
             else begin while i+2<=k do begin
                                  s:=s+'8';
                                   i:=i+2;
                                   end;
                 if i+1=k then s:=s+'4';
                 end;
      if length(s)>18 then s:='-1';
      writeln(s);
end.

program hrn;
 var
  a:qword;
  k,p,q,i:longint;
 begin
  read(k);
  if k>36 then write('-1')
          else begin
           p:=k div 2;
           q:=k mod 2;
           for i:=1 to p do a:=a*10+8;
           for i:=1 to q do a:=a*10+6;
           write(a);
          end;
 end.

Program grf1;
Var i,n,b,c,k: Longint; a: array[1..100000] of Longint;
Begin
Read(k);
If k>=37 Then begin Writeln('-1'); halt;end;
For i:=1 to k+1 do
 begin
  If k-2>=0 then
   begin
    Write('8');
    k:=k-2;
   end
   else begin
    Writeln('4'); k:=k-1;end;
If k<=0 Then begin break;end; end;
end.

var
  k:longint;
begin
  readln(k);
  if k>36 then
    write(-1)
  else begin
    if k=0 then
      write(1)
    else begin
      while k>=2 do begin
        write(8);
        dec(k,2);
      end;
      if k=1 then write(4);
    end;
  end;
end.

var
k,i:integer;
begin
readln(k);
if k>36 then writeln(-1) else while k>0 do begin
if k mod 2=0 then begin
write(8);
k:=k-2;
end;
if k mod 2=1 then begin
write(4);
k:=k-1;
end;
end;
end.

var
 n,i:longint;
begin
 readln(n);
 if n>36 then begin writeln(-1); halt; end;
 for i:=1 to n div 2 do
  write(8);
 if odd(n) then write(6); writeln;
end.

program hrn;
 var
  a:qword;
  k,p,q,i:longint;
 begin
  read(k);
  if k>36 then write('-1')
          else begin
           p:=k div 2;
           q:=k mod 2;
           for i:=1 to p do a:=a*10+8;
           if a <> 0 then write(a);
           for i:=1 to q do write(4);
          end;
  readln;readln;
 end.

var n,i:longint;

begin
//assign(input,'ygfrddd.in');reset(input);
//(output,'ygfrddd.out');rewrite(output);
readln(n);
if n>36 then
  write(-1)
else
  begin
  if n>18 then
    begin
    for i:=1 to n-18 do
      write(8);
    for i:=1 to n-(n-18)*2 do
      write(6);
    end
  else
    for i:=1 to n do write(6);
  end;
close(input);close(output);
end.

var
  k, ans : int64;
begin
  readln(k);
  if k > 36
    then writeln(-1)
    else
      begin
        while k >= 2 do
          begin
            ans := ans * 10 + 8;
            dec(k, 2);
          end;
        if k = 1
          then ans := ans * 10 + 9;
        writeln(ans);
      end;
end.

var
k:longint;
c:int64;
begin
read(k);
if k>36 then
begin write(-1);
halt; end;
if k=1 then
begin write('6');
halt; end;
c:=0;
while k>1 do
begin dec(k,2);
c:=c*10+8;
end;
if k>0 then
c:=c*10;
write(c);
end.

const num:array[0..9]of longint=(1,0,0,0,1,0,1,0,2,1);
var  k,i:longint;
begin
  read(k);
  if k>18*2 then
  begin
    writeln('-1');
    exit;
  end;
  for i:=1 to 18 do
  begin
    if k>=2 then
    begin
      write(8);
      dec(k,2);
    end else
    if k=1 then
    begin
      write(4);
      dec(k);
    end;
    if k=0 then break;
  end;
  writeln;
end.

var k:integer;
i:integer;
begin
read(k);
if k>36 then
  begin
  writeln('-1');
  halt;
  end;
while k>0 do
  begin
  if k>1 then
    begin
    write('8');
    k:=k-2;
    end
    else
    begin
    write('4');
    k:=k-1;
    end;
  end;

end.

uses math;

var n, i : longint;
	s : string;
begin
{$ifndef ONLINE_JUDGE}
	assign(input,'input.txt');
{$else}
	//assign(input,'road.in');
	//assign(output,'road.out');
{$endif}
	reset(input);rewrite(output);

	readln(n);

	if n > 36 then
		s := '-1'
	else
		while (n > 0) do
			if (n >= 2) then
				begin
					s := s + '8';
					dec(n,2);
				end
			else
				begin
					s := s + '4';
					dec(n);
				end;

	writeln(s);

	close(input);
	close(output);
end.

var c,i:longint;
begin
  readln(c);
  if c>36 then
    writeln(-1)
  else
  begin
    for i:=1 to c div 2 do
      write(8);
    if c mod 2=1 then
      write(6);
  end;
end.

 var k:longint;
begin
 readln(k);
 if k>36 then
   writeln(-1)
 else begin
   while k>1 do begin
     write('8');
     dec(k,2);
   end;
   if k>0 then
     writeln(4);
 end;
end.

var s:string;
    k,i,n:longint;
begin
 readln(n);
 if n>36
 then begin
  writeln(-1);
  exit;
 end;
 while n>0 do
 begin
  if n>1
  then begin
   s:=s+'8';
   n:=n-2;
  end
  else begin
   s:=s+'4';
   n:=n-1;
  end;
 end;
 writeln(s);
end.

var
 n,i:longint;
begin
 readln(n);
 if n>36 then begin write(-1);halt; end;
 for i:=1 to n div 2 do write(8);
 if n mod 2=1 then write(6);
end.

Var z,x,k,i,n: longint;
begin
Read(k);
If k>36 then begin Write('-1');exit;end;
If k mod 2=0 then begin n:=k div 2;
For i:=1 to n do
Write('8');
end else begin n:=(k-1) div 2;
For i:=1 to n do
Write('8');
Write('4');
end;
end.

var i:longint;
var n:int64;
begin
  read(n);
  if n>=37 then begin writeln(-1);exit;end;
  for i:=1 to n  div 2 do write(8);
  for i:=1 to n mod 2 do write(4);writeln;
end.

var i,j,k:longint;
  begin
  { assign (input,'input.txt');
   reset (input);
   assign (output,'output.txt');
   rewrite (output);  }
   read (k);
    if k>36 then writeln (-1)
      else
     begin
     while k-1>0 do
      begin
       write (8);
       k:=k-2;
      end;
  if k=1 then write (4);
      end;

  end.

var k,i:longint;
begin
 readln(k);
 if k>36 then
  writeln('-1')
 else
  begin
   for i:=1 to k div 2 do
    write('8');
   if k mod 2=1 then
    write('6');
  end;
 writeln;
end.

var
 k,i:longint;
begin
 read(k);
 if k>36 then
  begin
   writeln('-1');
   halt;
  end;
  for i:=1 to k div 2 do write(8);
  if odd(k) then write(6);
  writeln;
end.

const fin='a.inp';fon='a.out';
var k,i:longint;
begin
    //assign(input,fin);
    //reset(input);
    //assign(output,fon);
    //rewrite(output);
    readln(k);
    if (k<37) then
    begin
        for i:=1 to k div 2 do
            write('8');
        if k mod 2=1 then write('4');
    end
    else
        write('-1');
end.

var k,n,o: integer;
    res: string;

begin
 readln(k);
 n:= k div 2;
 o:= k mod 2;
 res:='';
 if n+o<=18 then
  begin
  for var i:=1 to n do
   res:=res+'8';
  if o>0 then
   res:=res+'6';
  end
 else
  res:='-1';

 writeln(res);

end.

var
i,k:longint;
res: string;
begin
read(k);
res:='';
if k>36 then write(-1)
else begin
for i:=1 to k div 2  do
res:=res+'8';
if k mod 2 <>0 then res:=res+'6';
end;
writeln(res);
end.

Var k:integer; s:string;
Begin
  readln(k);
  if k>36 then writeln('-1') else
  begin
  if k=0 then s:='1';
  If k mod 2 = 1 then begin s:=s+'4'; k:=k-1; end;
  while (k<>0) do
  begin
  s:=s+'8';
  k:=k-2;
  end;
  writeln(s);
  end;
  end.

program gg;
var k:int64;
begin
read(k);
if k>36 then begin
write(-1);
halt(0);
end;
if k mod 2  = 1 then begin
write(6);
k:=k-1;
end;
while k<>0 do begin
write(8);
k:=k-2;
end;
end.

Program ILoveYou;
VAR n,i:int64;
Begin

Readln(n);

if (n > 36) then Writeln('-1') else
Begin

for i:=1 to (n div 2) do
Begin
Write('8');
end;

for i:=1 to (n mod 2) do
Begin
Write('4');
end;

end;

Readln;
END.

Var
  k: UInt64;

Begin
  Read(k);
  If k > 36 then Write(-1)
  Else Begin
    For Var i := 1 to k div 2 do
      Write(8);
    If k mod 2 <> 0 then Write(6)
  End;
End.

var k:int64;

begin
readln(k);
if k = 1 then writeln(0) else
if k > 36 then writeln(-1) else
    begin
    if k mod 2 = 1 then write(4);
    for var i:=1 to (k div 2) do write(8);
    writeln;
    end;
end.

program chislo;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   n:integer;
begin
   readln(n);
   if(n>36)then writeln(-1)
   else begin
   while(n>0)do begin
      if(n>=2)then begin
      write(8);
      n:=n-2;
      end
      else begin
      write(0);
      n:=n-1;
      end
   end;
   end;
   readln;
end.

program Big_stavka;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var b,c,i,k: longint;
begin
readln(k);
b:=k div 2;
c:=k mod 2;
for i:=1 to b do
  write(8);
for i:=1 to c do
  write(4);
end.

var i:longint;
var n:int64;
begin
  read(n);
  if n>=35 then begin writeln(-1);exit;end;
  for i:=1 to n  div 2 do write(8);
  for i:=1 to n mod 2 do write(0);writeln;
end.

var i:longint;
var n:int64;
begin
  read(n);
  if n>=36 then begin writeln(-1);exit;end;
  for i:=1 to n  div 2 do write(8);
  for i:=1 to n mod 2 do write(9);writeln;
end.

var k,i:int64; s:string;
begin readln(k);
      i:=0; s:='';
      if k=1 then s:='4'
             else begin while i+2<=k do begin
                                  s:=s+'8';
                                   i:=i+2;
                                   end;
                 if i+1=k then s:=s+'4';
                 end;
      writeln(s);
end.

var k,i:int64; s:string;
begin readln(k);
      i:=0; s:='';
      if k=1 then s:='4'
             else begin while i+2<=k do begin
                                  s:=s+'8';
                                   i:=i+2;
                                   end;
                 if i+1=k then s:=s+'4';
                 end;
      writeln(s);
      readln;
end.

Program grf1;
Var i,n,b,c,k: Longint; a: array[1..100000] of Longint;
Begin
Read(k);
If k>=36 Then begin Writeln('-1'); halt;end;
For i:=1 to k+1 do
 begin
  If k-2>=0 then
   begin
    Write('8');
    k:=k-2;
   end
   else begin
    Writeln('4'); k:=k-1;end;
If k<=0 Then begin break;end; end;
end.

Program grf1;
Var i,n,b,c,k: Longint; a: array[1..100000] of Longint;
Begin
Read(k);
If k>=1000000 Then begin Writeln('-1'); halt;end;
For i:=1 to k+1 do
 begin
  If k-2>=0 then
   begin
    Write('8');
    k:=k-2;
   end
   else begin
    Writeln('4'); k:=k-1;end;
If k<=0 Then begin break;end; end;
end.

Program grf1;
Var i,n,b,c,k: Longint; a: array[1..100000] of Longint;
Begin
Read(k);
For i:=1 to k+1 do
 begin
  If k-2>=0 then
   begin
    Write('8');
    k:=k-2;
   end
   else
    Writeln('4'); k:=k-1;
If k=0 Then begin break;end; end;
end.

Program grf1;
Var i,n,b,c,k: Longint; a: array[1..100000] of Longint;
Begin
Read(k);
For i:=1 to k+1 do
 begin
  If k-2>=0 then
   begin
    Write('8');
    k:=k-2;
   end
   else begin
    Writeln('4'); k:=k-1;end;
If k<=0 Then begin break;end; end;
end.

Program grf1;
Var i,n,b,c,k: Longint; a: array[1..100000] of Longint;
Begin
Read(k);
For i:=1 to k+1 do
 begin
  If k-2>=0 then
   begin
    Write('8');
    k:=k-2;
   end
   else
    Writeln('4'); k:=k-1;
If k<=0 Then begin break;end; end;
end.

var
  k:longint;
begin
  readln(k);
  if k>36 then
    write(-1)
  else begin
    if k=0 then
      write(1)
    else begin
      while k>=2 do begin
        write(8);
        dec(k,2);
      end;
      if k=1 then write(0);
    end;
  end;
end.

var
k,i:integer;
begin
readln(k);
if k>36 then writeln(-1) else while k>0 do begin
if k mod 2=0 then begin
write(8);
k:=k-2;
end;
if k mod 2=1 then begin
write(0);
k:=k-1;
end;
end;
end.

program hrn;
 var
  a:qword;
  k,p,q,i:longint;
 begin
  read(k);
  if k>36 then write('-1')
          else begin
           p:=k div 2;
           q:=k mod 2;
           for i:=1 to p do a:=a*10+8;
           for i:=0 to q do a:=a*10;
           write(a);
          end;
  readln;readln;
 end.

program hrn;
 var
  a:qword;
  k,p,q,i:longint;
 begin
  read(k);
  if k>36 then write('-1')
          else begin
           p:=k div 2;
           q:=k mod 2;
           for i:=0 to p do a:=a*10+8;
           for i:=0 to q do a:=a*10;
           write(a);
          end;
  readln;readln;
 end.

program hrn;
 var
  a:qword;
  k,p,q,i:longint;
 begin
  read(k);
  if k>36 then write('-1')
          else begin
           p:=k div 2;
           q:=k mod 2;
           for i:=1 to p do a:=a*10+8;
           write(a);
           for i:=1 to q do write(4);
          end;
  readln;readln;
 end.

var
  k, ans : int64;
begin
  readln(k);
  if k > 36
    then writeln(-1)
    else
      begin
        while k >= 2 do
          begin
            ans := ans * 10 + 8;
            dec(k, 2);
          end;
        if k = 1
          then ans := ans * 10;
        writeln(ans);
      end;
end.

var
k:longint;
c:int64;
begin
read(k);
if k>36 then
begin write(-1);
halt; end;
c:=0;
while k>1 do
begin dec(k,2);
c:=c*10+8;
end;
if k>0 then
c:=c*10;
write(c);
end.

const num:array[0..9]of longint=(1,0,0,0,1,0,1,0,2,1);
var  k,i:longint;
begin
  read(k);
  if k>18*2 then
  begin
    writeln('-1');
    exit;
  end;
  for i:=1 to 18 do
  begin
    if k>=2 then
    begin
      write(8);
      dec(k,2);
    end else
    if k=1 then
    begin
      write(0);
      dec(k);
    end;
    if k=0 then break;
  end;
  writeln;
end.

uses math;

var n, i : longint;

begin
{$ifndef ONLINE_JUDGE}
	assign(input,'input.txt');
{$else}
	//assign(input,'road.in');
	//assign(output,'road.out');
{$endif}
	reset(input);rewrite(output);

	readln(n);

	if n > 32 then
		writeln(-1)
	else
		begin
			for i := 1 to n div 2 do
				write(8);
			if n mod 2 = 1 then
				write(0);
		end;

	close(input);
	close(output);
end.

uses math;

var n, i : longint;

begin
{$ifndef ONLINE_JUDGE}
	assign(input,'input.txt');
{$else}
	//assign(input,'road.in');
	//assign(output,'road.out');
{$endif}
	reset(input);rewrite(output);

	readln(n);

	if n > 36 then
		writeln(-1)
	else
		begin
			for i := 1 to n div 2 do
				write(8);
			if n mod 2 = 1 then
				write(0);
		end;

	close(input);
	close(output);
end.

 var k:longint;
begin
 readln(k);
 if k>36 then
   writeln(-1)
 else begin
   while k>1 do begin
     write('8');
     dec(k,2);
   end;
   if k>0 then
     writeln(0);
 end;
end.

program hrn;
 var
  a:qword;
  k,p,q,i:longint;
 begin
  read(k);
  if k>36 then write('-1')
          else begin
           p:=k div 2;
           q:=k mod 2;
           for i:=1 to p do a:=a*10+8;
           for i:=1 to q do a:=a*10+0;
           write(a);
          end;
 end.

Var z,x,k,i,n: longint;
begin
Read(k);
If k>38 then begin Write('-1');exit;end;
If k mod 2=0 then begin n:=k div 2;
For i:=1 to n do
Write('8');
end else begin n:=(k-1) div 2;
For i:=1 to n do
Write('8');
Write('4');
end;
end.

Var z,x,k,i,n: longint;
begin
Read(k);
If k>19 then begin Write('-1');exit;end;
If k mod 2=0 then begin n:=k div 2;
For i:=1 to n do
Write('8');
end else begin n:=(k-1) div 2;
For i:=1 to n do
Write('8');
Write('4');
end;
end.

program hrn;
 var
  a:qword;
  k,p,q,i:longint;
 begin
  read(k);
  if k>36 then write('-1')
          else begin
           p:=k div 2;
           q:=k mod 2;
           for i:=1 to p do a:=a*10+8;
           for i:=1 to q do a:=a*10+0;
          end;
  write(a);
 end.

var i:longint;
var n:int64;
begin
  read(n);
  if n>=37 then begin writeln(-1);exit;end;
  for i:=1 to n  div 2 do write(8);
  for i:=1 to n mod 2 do write(0);writeln;
end.

var i,j,k:longint;
  begin
   {assign (input,'input.txt');
   reset (input);
   assign (output,'output.txt');
   rewrite (output); }
   read (k);
    if k>34 then writeln (-1)
      else
     while k-1>0 do
      begin
       write (8);
       k:=k-2;
      end;

  if k=1 then write (0);

  end.

var i,j,k:longint;
  begin
  { assign (input,'input.txt');
   reset (input);
   assign (output,'output.txt');
   rewrite (output);  }
   read (k);
    if k>34 then writeln (-1)
      else
     begin
     while k-1>0 do
      begin
       write (8);
       k:=k-2;
      end;
  if k=1 then write (4);
      end;

  end.

var i,j,k:longint;
  begin
  { assign (input,'input.txt');
   reset (input);
   assign (output,'output.txt');
   rewrite (output);  }
   read (k);
    if k>35 then writeln (-1)
      else
     begin
     while k-1>0 do
      begin
       write (8);
       k:=k-2;
      end;
  if k=1 then write (4);
      end;

  end.

const fin='a.inp';fon='a.out';
var k,i:longint;
begin
    //assign(input,fin);
    //reset(input);
    //assign(output,fon);
    //rewrite(output);
    readln(k);
    for i:=1 to k div 2 do
        write('8');
    if k mod 2<>0 then
        write('4');
end.

const fin='a.inp';fon='a.out';
var k,i:longint;
begin
    //assign(input,fin);
    //reset(input);
    //assign(output,fon);
    //rewrite(output);
    readln(k);
    if k div 2<19 then
    begin
        for i:=1 to k div 2 do
            write('8');
        if k mod 2<>0 then
            write('4');
    end
    else
        write('-1');
end.

var k,n,o: integer;
    res: string;

begin
 readln(k);
 n:= k div 2;
 o:= k mod 2;
 res:='';
 if n+o<=18 then
  begin
  for var i:=1 to n do
   res:=res+'8';
  if o>0 then
   res:=res+'0';
  end
 else
  res:='-1';

 writeln(res);

end.

Var k:integer; s:string;
Begin
  readln(k);
  if k>36 then writeln('NO') else
  begin
  if k=0 then s:='1';
  If k mod 2 = 1 then begin s:=s+'4'; k:=k-1; end;
  while (k<>0) do
  begin
  s:=s+'8';
  k:=k-2;
  end;
  writeln(s);
  end;
  end.

program gg;
var k:int64;
begin
read(k);
if k>34 then begin
write(-1);
halt(0);
end;
while k<>0 do begin
if k>=2 then begin
write(8);
k:=k-2;
end
else begin
write(0);
k:=k-1;
end;
end;
end.

program gg;
var k:int64;
begin
read(k);
if k>36 then begin
write(-1);
halt(0);
end;
while k<>0 do begin
if k>=2 then begin
write(8);
k:=k-2;
end
else begin
write(0);
k:=k-1;
end;
end;
end.

Program ILoveYou;
VAR n,i:int64;
Begin

Readln(n);

if (n > 36) then Writeln('-1') else
Begin

for i:=1 to (n div 2) do
Begin
Write('8');
end;

for i:=1 to (n mod 2) do
Begin
Write('0');
end;

end;

Readln;
END.

Var
  k: UInt64;

Begin
  Read(k);
  If k > 36 then Write(-1)
  Else Begin
    For Var i := 1 to k div 2 do
      Write(8);
    If k mod 2 <> 0 then Write(1)
  End;
End.