Var n,i,k,s,j,l,r,ans,v,p,sr,x : Int64;
begin
 Readln(n);
   l:=0;
   r:=n;
   if n=1 then begin
               writeln(1);
               halt;
               end;
   ans:=1000000000000000000;
   x:= n div 2 + n mod 2;
    while r-l>1 do
    begin
    sr:=(r+l) div 2;
    v:=0; p:=0; k:=n; i:=0;
     while k>0 do
     begin
                            if k>=sr then begin
                                          k:=k-sr;
                                          v:=v+sr;
                                          end
                                     else begin
                                          v:=v+k;
                                          k:=0;
                                          end;
                        begin
                            k:=k - k div 10;
                            p:=p+k div 10;
                            end;
     end;
       if v >= x then r:=sr
                 else l:=sr;

    end;
     writeln(r);
end.

var
  l, r, m: int64;

var
  i, j, k, n, poel: int64;

var
  min: int64;

begin
  readln(n);
  if (n mod 2 = 0) then min := n div 2 else min := n div 2 + 1;

  l := 0;
  r := n div 2 + 1;

  while (l+1 < r) {and (poel <> min)} do
  begin
    k := n;
    poel := 0;
    m := (l + r) div 2;

    while (k > 0)  do
    begin
      if (k >= m) then
      begin
        k := k - m;
        poel += m;
      end else
      begin
        poel += k;
        k := 0;
      end;
      k := k - k div 10;
    end;

    if (poel >= min) then r := m  else l := m ;
  end;

  writeln(r);
end.

var n,t,w,mid,b:int64;
function pd(x:int64):boolean;
var m,y,z:int64;
begin
m:=n;y:=0;z:=0;
while m>0 do
  begin
  if m<x then y:=y+m
  else y:=y+x;
  if m<x then m:=0 else m:=m-x;
  if m>=10 then z:=z+m div 10;
  m:=m-m div 10;
  end;
exit(y>=(n+1) div 2);
end;
begin
//assign(input,'tg.in');reset(input);
//assign(output,'tg.out');rewrite(output);
readln(n);
t:=1;w:=n;
while t<=w do
  begin
  mid:=(t+w) div 2;
  if pd(mid) then
    begin
    w:=mid-1;
    b:=mid;
    end
  else t:=mid+1;
  end;
writeln(b);
close(input);close(output);
end.

var
   n , l , r , mid , a , b , x : int64 ;
begin
     readln( n ) ;
     l := 0 ; r := n ;
     while l + 1 < r do
     begin
          mid := ( l + r ) div 2 ;
          a := 0 ; b := 0 ; x := n ;
          while x > 0 do
          begin
               if x > mid then
               begin
                    a := a + mid ;
                    x := x - mid ;
               end
               else
                begin
                     a := a + x ;
                     x := 0 ;
                end ;
               b := b + x div 10 ;
               x := x - x div 10 ;
          end ;
          if a >= b then r := mid
          else l := mid ;
    end ;
    writeln( r ) ;
end.

uses    math;
var     n,l,r,ans,k:int64;
function check(k,n: int64): boolean;
var sum,cur,o: int64;
begin
        sum:=0; cur:=n;
        while cur>0 do begin
          o:=min(cur,k);
          sum:=sum+o;
          cur:=cur-o;
          cur:=cur-cur div 10;
        end;
        if sum*2>=n then exit(true)
        else exit(false);
end;

begin
        readln(n);
        l:=1; r:=n;
        ans:=r;
        while l<=r do begin
          k:=(l+r) div 2;
          if check(k,n) then begin
            ans:=k;
            r:=k-1;
          end
          else l:=k+1;
        end;
        writeln(ans);
end.

program Eclair;

function f(n, k: Int64): Boolean;

var
        s, n_orig: Int64;

begin
        n_orig := n;
        s := 0;

        while n >= k do begin
                n := n - k;
                n := n - n div 10;
                Inc (s, k)
        end;

        Inc (s, n);

        f := s * 2 >= n_orig
end;

var
        n, k: Int64;
        l, r, m: Int64;

begin
        ReadLn (n);

        l := 0;
        r := n + 1;

        while l + 1 < r do begin
                m := (l + r) div 2;

                if f(n, m) then
                        r := m
                else
                        l := m
        end;

        WriteLn (r)
end.

var n,k : int64;

function test(k:int64) : boolean;
var
  i,s,sv: int64;
begin
  s:=n;
  sv:=0;
  while s>0 do
  begin
    if s>=k
    then begin
         sv:=sv+k;
         s:=s-k;
         end
    else begin
         sv:=sv+s;
         s:=0;
         end;
    s:=s-s div 10;
  end;
  if 2*sv>=n then test:=true
    else test:=false;
end;

procedure find(l,r:int64);
begin
  if l=r then k:=l
  else
    begin
    k:=(l+r) div 2;
    if test(k) then find(l,k)
      else find(k+1,r);
    end;
end;

begin
  read(n);
  find(1,n);
  write(k);
end.

program c;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
n,n2,k,kl,kr,s,l:int64;
begin
readln(n);
kl:=1;
kr:=n;
repeat
  k:=(kl+kr) div 2;
  //writeln(kl, ' ', k, ' ', kr);
  s:=0;
  n2:=n;
    repeat
      n2:=n2-k;
      s:=s + n2 div 10;
      n2:= n2 - (n2 div 10);
    until ((n2<=0) or(2*s>n));
    if (2*s<=n) then
    kr:=k
    else
    kl:=k;
  until (kr-kl<=1);
  s:=0;
  n2:=n;
    repeat
      n2:=n2-kl;
      s:=s + n2 div 10;
      n2:= n2 - (n2 div 10);
    until ((n2<=0) or(2*s>n));
if (2*s<=n) then
write(kl)
else
write(kr);
end.

              const eps=0.00000001;  besk1=200000008;  nn=600000;
              modul=1000000007;
   besk=8000000000000000000;
   label 1,2,3,4;
    type    real=extended;   double=extended;
    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 prod,ll,rr,posx,posy,gr,n,dloch,newdl,oldn,oldm,pos1,pos2,ost,ot,aa,bb,cc,p1,p2,p3,p4,kk,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,pmax,imax,t,nm,m,smin,cen:int64;
   ot1,ot2,k,i1,j1,step1, step, i,j:longint;
    ppp,prob1,prob2,prob3,pr1new,pr2new,pr3new,pr1,pr2,pr3:zap;
    oldpos,finot,vv,znak:int64;
    px,py,xc,yc,xxc,yyc:extended;
    pos:array[-1..500001,-1..50] of longint;
    next,prev,x,y,xx,yy,str,kol,s,time,name,d,dnew, voltay,l,r,c,z,day,b,a:array[-300000..1600000] of int64;
    zz:array[0..125000000] of byte;
    pole:array[-10..1002,-10..1005] of char;
    ddd,dd1,dd2,dd3,dd4,dd,ddsum:array[-10..1101,-10..1010] of int64;
   marked,zanx,zany:array[-10..2000000] of boolean;
    sss1,sss2:string;
    stepen,koled,def,mindef,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;
    right,left,numleft,numright,dr: array [-1..60,-1..60,-1..110] of int64;
    s2,s1:array[-100..200000] of string;

    grr :array [-10..2010,-10..2010] of boolean;
    maxpr:array[0..nn] of string;
    sss:array[-10..nn] of string;
     tx,ty,vel,x1,y1,ott,v0,v1,s0,t0:int64;
     zv:point;
     ugol,rot,temp,sumtemp,vol,newx,newy:array[-1000..400000] of int64;
     sq,sqx,sqy,ottt,aaa,bbb,ccc: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;

      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 kkol(kk:int64):int64;
var i,j:longint; ot,sum,pp:int64;
begin
   ot:=0;
   pp:=p;
   while pp>0 do
     begin
        ot:=ot+min(kk,pp);
        pp:=pp- min(kk,pp);
        pp:=pp-(pp div 10);

     end;
   kkol:=ot;

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:longint):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;

begin

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

     read(p);
  {   for i:=1 to 10 do begin aa:=i; writeln(i,' ',kkol(aa*1000000000));  end;
  }  aa:=1; bb:=p; cc:=aa;
  while abs(aa-bb)>1 do
    begin
       cc:=(aa+bb) shr 1;
       if 2*kkol(cc)>p then bb:=cc else aa:=cc;

    end;
 {  writeln(cc);
  }
  cc:=max(cc-3,0);
  repeat inc(cc) until 2*kkol(cc)>=p;

  writeln(cc);

   1:          close(output);
end.

Var n,i,k,s,j,l,r,ans,v,p,sr,x : Int64;
begin
 Readln(n);
   l:=0;
   r:=n;
   if n=1 then begin
               writeln(1);
               halt;
               end;
   ans:=1000000000000000000;
   x:= n div 2 + n mod 2;
    while r-l>1 do
    begin
    sr:=(r+l) div 2;
    v:=0; p:=0; k:=n; i:=0;
     while k>0 do
     begin
                            if k>=sr then begin
                                          k:=k-sr;
                                          v:=v+sr;
                                          end
                                     else begin
                                          v:=v+k;
                                          k:=0;
                                          end;
                        begin
                            k:=k - k div 10;
                            p:=p+k div 10;
                            end;
     end;
       if v >= x then begin
                            if sr<ans then ans:=sr;
                            r:=sr;
                            end
                       else l:=sr;

    end;
     writeln(ans);
end.

uses    math;
const   fi='991C.inp'; fo='991C.out';
var     n,l,r,ans,k:int64;
function check(k,n: int64): boolean;
var sum,cur,o: int64;
begin
        sum:=0; cur:=n;
        while cur>0 do begin
          o:=min(cur,k);
          sum:=sum+o;
          cur:=cur-o;
          cur:=cur-cur div 10;
        end;
        if sum*2>=n then exit(true)
        else exit(false);
end;

begin
    //    assign(input,fi);reset(input);
    //    assign(output,fo);rewrite(output);
        readln(n);
        l:=1; r:=n;
        ans:=r;
        while l<=r do begin
          k:=(l+r) div 2;
          if check(k,n) then begin
            ans:=k;
            r:=k-1;
          end
          else l:=k+1;
        end;
        writeln(ans);
end.

var a,s,b,c,n,i,m,k,j,x,y,z: int64;
begin
 read( n);
 A:=0;B:=N;
 while b-a>1 do
 begin
 c:=(a+b)div 2;
 x:=0;y:=0;z:=n;
 while z>0 do
 begin
  If c>z then begin x:=x+z;z:=0; end else begin x:=x+c;z:=z-c;end;
  z:=z-z div 10;
 end;
 if x+x<n then a:=c else b:=c;
 end;
 write(b);

end.

var n,t,w,mid,s,x,bao:int64;
begin
//assign(input,'tg.in');reset(input);
//assign(output,'tg.out');rewrite(output);
readln(n);
t:=1;w:=n;
while t<=w do
  begin
  mid:=(t+w) div 2;s:=0;x:=n;
  while x>=mid do
    begin
    x:=x-mid;s:=s+mid;x:=x-x div 10;
    end;
  s:=s+x;
  if s>=(n+1) div 2 then
    begin
    bao:=mid;w:=mid-1;
    end
  else t:=mid+1;
  end;
writeln(bao);
close(input);close(output);
end.

program c;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
n,n2,k,kl,kr,s,l:int64;
begin
readln(n);
kl:=1;
kr:=n;
repeat
  k:=(kl+kr) div 2;
  s:=0;
  n2:=n;
    repeat
      n2:=n2-k;
      s:=s + n2 div 10;
      n2:= n2 - (n2 div 10);
    until ((n2<=0) or(2*s>n));
    if (2*s<=n) then
    kr:=k
    else
    kl:=k;
  until (kr-kl<=1);
write(kr);
end.

Var n,i,k,s,j,l,r,ans,v,p,sr : Int64;
begin
 Readln(n);
   l:=0;
   r:=n;
   if n=1 then begin
               writeln(1);
               halt;
               end;
   ans:=1000000000000000000;
    while r-l>1 do
    begin
    sr:=(r+l) div 2;
    v:=0; p:=0; k:=n; i:=0;
     while k>0 do
     begin
                            if k>=sr then begin
                                          k:=k-sr;
                                          v:=v+sr;
                                          end
                                     else begin
                                          v:=v+k;
                                          k:=0;
                                          end;
                        begin
                            k:=k - k div 10;
                            p:=p+k div 10;
                            end;
     end;
       if v >= n div 2 then begin
                            if sr<ans then ans:=sr;
                            r:=sr;
                            end
                       else l:=sr;

    end;
     writeln(ans);
end.

Var n,i,k,s,j,l,r,ans,v,p,sr : Int64;
begin
 Readln(n);
   l:=0;
   r:=n;
   ans:=1000000000000000000;
    while r-l>1 do
    begin
    sr:=(r+l) div 2;
    v:=0; p:=0; k:=n; i:=0;
     while k>0 do
     begin
       inc(i);
       if i mod 2 <> 0 then begin
                            if k>=sr then begin
                                          k:=k-sr;
                                          v:=v+sr;
                                          end
                                     else begin
                                          v:=v+k;
                                          k:=0;
                                          end;
                            end
                       else begin
                            k:=k - k div 10;
                            p:=p+k div 10;
                            end;
     end;
       if v >= n div 2 then begin
                            if sr<ans then ans:=sr;
                            r:=sr;
                            end
                       else l:=sr;

    end;
     writeln(ans);
end.

uses    math;
const   fi='991C.inp'; fo='991C.out';
var     n,l,r,ans,k:int64;
function check(k,n: longint): boolean;
var sum,cur,o: int64;
begin
        sum:=0; cur:=n;
        while cur>0 do begin
          o:=min(cur,k);
          sum:=sum+o;
          cur:=cur-o;
          cur:=cur-cur div 10;
        end;
        if sum*2>=n then exit(true)
        else exit(false);
end;

begin
    //    assign(input,fi);reset(input);
    //    assign(output,fo);rewrite(output);
        readln(n);
        l:=1; r:=n;
        ans:=r;
        while l<=r do begin
          k:=(l+r) div 2;
          if check(k,n) then begin
            ans:=k;
            r:=k-1;
          end
          else l:=k+1;
        end;
        writeln(ans);
end.

var n,t,w,mid,bao:int64;
function pd(x:int64):boolean;
var y,s:int64;
begin
y:=n;s:=0;
if x=0 then exit(false);
while true do
  begin
  if y<x then break;
  if y=0 then break;
  y:=y-x;y:=y-trunc(y*0.1);s:=s+x;
  end;
s:=s+y;
if s>=n div 2 then exit(true);
exit(false);
end;
begin
//assign(input,'tg.in');reset(input);
//assign(output,'tg.out');rewrite(output);
readln(n);t:=0;w:=n;
while t<=w do
  begin
  mid:=(t+w) div 2;
  if pd(mid) then begin bao:=mid;w:=mid-1;end
  else t:=mid+1;
  end;
writeln(bao);
close(input);close(output);
end.

var n,t,w,x,y,z,mid:int64;
function min(x,y:int64):int64;
begin
if x>y then exit(y);
exit(x);
end;
begin
//assign(input,'tg.in'); reset(input);
//assign(output,'tg.out'); rewrite(output);
readln(n);
t:=1;w:=n;
while t<=w do
  begin
  mid:=(t+w) div 2;x:=n;y:=0;
  while x>0 do
    begin
    y:=y+min(mid,x);x:=x-min(mid,x);
    if x>10 then x:=x-x div 10;
    end;
  if y>n div 2 then
    begin
    z:=mid;w:=mid-1;
    end
  else t:=mid+1;
  end;
writeln(z);
close(input);close(output);
end.

var n,t,w,mid,b:int64;
function pd(x:int64):boolean;
var m,y,z:int64;
begin
m:=n;y:=0;z:=0;
while m>0 do
  begin
  if m<x then y:=y+m
  else y:=y+x;
  if m<x then m:=0 else m:=m-x;
  if m>=10 then z:=z+m div 10;
  m:=m-m div 10;
  end;
exit(y>=n div 2);
end;
begin
//assign(input,'tg.in');reset(input);
//assign(output,'tg.out');rewrite(output);
readln(n);
t:=1;w:=n;
while t<=w do
  begin
  mid:=(t+w) div 2;
  if pd(mid) then
    begin
    w:=mid-1;
    b:=mid;
    end
  else t:=mid+1;
  end;
writeln(b);
close(input);close(output);
end.

var n,t,w,mid,s,x,bao:int64;
begin
//assign(input,'tg.in');reset(input);
//assign(output,'tg.out');rewrite(output);
readln(n);
t:=1;w:=n;
while t<=w do
  begin
  mid:=(t+w) div 2;s:=0;x:=n;
  while x>=mid do
    begin
    x:=x-mid;s:=s+mid;x:=x-x div 10;
    end;
  s:=s+x;
  if s>=n div 2 then
    begin
    bao:=mid;w:=mid-1;
    end
  else t:=mid+1;
  end;
writeln(bao);
close(input);close(output);
end.

var n,t,w,s,x,o,z:int64;
function min(x,y:int64):int64;
begin
if x>y then exit(y);
exit(x);
end;
begin
//assign(input,'tg.in');reset(input);
//assign(output,'tg.out');rewrite(output);
readln(n);
t:=1;w:=n;
while t<=w do
 begin
 o:=(t+w) div 2;s:=n;x:=0;
 while s>0 do
   begin
   x:=x+min(o,s);s:=s-min(o,s);
   if s>10 then s:=s-s div 10;
   end;
 if x>=n div 2 then
   begin
   z:=o;w:=o-1;
   end
 else t:=o+1;
 end;
writeln(z);
close(input);close(output);
end.

program c;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
n,n2,k,s:int64;
begin
readln(n);
k:=n div 20;
repeat
  inc(k);
  s:=0;
  n2:=n;
    repeat
      n2:=n2-k;
      s:=s + n2 div 10;
      n2:= n2 - (n2 div 10);
    until ((n2<=0) or(2*s>n));
  until (2*s<=n);
write(k);
end.

program c;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
n,n2,k,s:int64;
begin
readln(n);
k:=n div 30;
repeat
  inc(k);
  s:=0;
  n2:=n;
    repeat
      n2:=n2-k;
      s:=s + n2 div 10;
      n2:= n2 - (n2 div 10);
    until ((n2<=0) or(2*s>n));
  until (2*s<=n);
write(k);
end.


var
  n,mh,i : longint;
  ans,ret : int64;
  was : array [1..35,1..35,0..37,0..1] of boolean;
  mem : array [1..35,1..35,0..37,0..1] of int64;

  function f(l,r,h,lab : longint) : int64;
    var
      res,r1,r2,r3,r4 : int64;
      i : longint;
    begin
      if h < 0 then exit(0);
      if (h = 0) and (l <> r) then exit(0);
      if (l=r) then
        begin
          if (lab = 0) and (h > 0) then exit(1);
          if (lab = 1) and (h = 0) then exit(1);
          exit(0);
        end;
      if was[l][r][h][lab] then exit(mem[l][r][h][lab]);
      was[l][r][h][lab]:=true;
      res:=0;
      inc(res,f(l+1,r,h-1,lab));
      inc(res,f(l,r-1,h-1,lab));
      for i:=l+1 to r-1 do
        begin
          if lab = 1 then
            begin
              r1:=f(l,i-1,h-1,1);
              r3:=f(l,i-1,h-1,0);
              r2:=f(i+1,r,h-1,1);
              r4:=f(i+1,r,h-1,0);
              inc(res,r1*r4);
              inc(res,r2*r3);
             inc(res,r1*r2);
           end else
           begin
             r1:=f(l,i-1,h-1,0);
             r2:=f(i+1,r,h-1,0);
             inc(res,r1*r2);
           end;
        end;
      mem[l][r][h][lab]:=res;
      exit(res);
    end;

begin
//  assign(input,'1.in'); reset(input);
 // assign(output,'1.out'); rewrite(output);
  readln(n,mh);
  for i:=mh to 37 do
    begin
      ret:=f(1,n,i-1,1);
      inc(ans,ret);
    end;
  writeln(ans);
end.

{$R+Q+,I+}
{$apptype console}
Uses SysUtils,math;
Var
   dp:Array[0..50,0..50] of Int64;
   n,h,i,j:Integer;
   ans:Int64;
Function Solve(n,h:Integer):Int64;
Var v,h1,h2,k1,k2:Integer;
Begin
   If dp[n,h]<>-1 Then Begin
      Solve:=dp[n,h];
      Exit;
   End;
   If n=1 Then Begin
      If h=1 Then dp[n,h]:=1
             Else dp[n,h]:=0;
      Solve:=dp[n,h];
      Exit;
   End;
   If h=0 Then Begin
      dp[n,h]:=0;
      Solve:=dp[n,h];
      Exit;
   End;
   dp[n,h]:=0;
   For v:=1 To n Do Begin
      k1:=v-1;
      k2:=n-v;
      If v=1 Then Begin
         dp[n,h]:=dp[n,h]+Solve(n-1,h-1);
         Continue;
      End;
      If v=n Then Begin
         dp[n,h]:=dp[n,h]+Solve(n-1,h-1);
         Continue;
      End;
      For h1:=0 To min(k1,h-2) Do dp[n,h]:=dp[n,h]+Solve(k1,h1)*Solve(k2,h-1);
      For h2:=0 To min(k2,h-2) Do dp[n,h]:=dp[n,h]+Solve(k1,h-1)*Solve(k2,h2);
      dp[n,h]:=dp[n,h]+Solve(k1,h-1)*Solve(k2,h-1);
   End;
   Solve:=dp[n,h];
End;
Begin
   Read(n,h);
   For i:=0 To 50 Do
      For j:=0 To 50 Do dp[i,j]:=-1;
   ans:=0;
   For i:=h To n Do ans:=ans+Solve(n,i);
   Write(ans);
End.

program D9;

{$APPTYPE CONSOLE}

{$R+}

uses
  SysUtils,
  Math;

var d: array[0..35, 0..35]of int64;

function dp(n, h: longint): int64;
     var i, k: longint;
         a1, a2, tmp: int64;
begin
  if d[n, h] = -1 then
  begin
    d[n, h] := 0;
    for i := h - 1 to n - 1 do
      for k := 0 to min(n - 1 - i, h - 1) do
        if not((k = h - 1)and(i < n - i - 1))then
        begin
          a1 := dp(i, h - 1);
          a2 := dp(n - i - 1, k);
        if (i = n - i - 1)and(k = h - 1)then
        begin
          tmp := a1 * a2;
           d[n, h] := d[n, h] + tmp;
        end
          else d[n, h] := d[n, h] + 2 * a1 * a2;
      end;
  end;
  result := d[n, h];
end;

var n, h: longint;

function solve: int64;
     var i, j: longint;
begin
  for i := 0 to n do
    for j := 0 to n do
      d[i, j] := -1;
  for i := 0 to 5 do
    for j := 1 shl i to n do
      d[j, i] := 0;
  d[0, 0] := 1;
  for i := 0 to n do
    for j := i + 1 to n do
      d[i, j] := 0;
  result := 0;
  for i := h to n do
    result := result + dp(n, i);
end;

begin
//reset(input, 'input.txt'); rewrite(output, 'output.txt');
  read(n, h);
  writeln(solve);
  readln; readln;
end.

USES MATH;
CONST
   fin='';
   fon='';
VAR
   n,h: LONGINT;
   f: array[0..40,0..40] of INT64;
PROCEDURE BAT_DAU;
   BEGIN
      assign(input,fin);
      reset(input);
      assign(output,fon);
      rewrite(output);
   END;
PROCEDURE CHUONG_TRINH;
   VAR
      kq: INT64;
      i,hi,j,l,r: LONGINT;
   BEGIN
      readln(n,h);
      FILLCHAR(f,SIZEOF(f),0);
      f[0,0]:=1;
      for i:=1 to n do
         for hi:=1 to i do
            for j:=0 to i-1 do
               for l:=0 to j do
                  for r:=0 to i-l-1 do
                  begin
                     if MAX(r,l)=hi-1 then
                     begin
                        f[i,hi]:=f[i,hi]+
                        f[j,l]*f[i-j-1,r];
                     end;
                  end;
      kq:=0;
      for i:=h to n do kq:=kq+f[n,i];
      writeln(kq);
   END;
PROCEDURE KET_THUC;
   BEGIN
      close(input);
      close(output);
   END;
BEGIN
   BAT_DAU;
   CHUONG_TRINH;
   KET_THUC;
END.

var res:array[1..35,1..100,1..100]of qword;
        a:array[1..35,1..35]of qword;
        n,k,i,j,t,v,u:longint;
        kq:qword;
function max(a,b:longint):longint;
begin
if a>b then max:=a else max:=b;
end;
begin
readln(n,k);
res[1,1,1]:=1;
a[1,1]:=1;
for i:=2 to n do
        begin
        for j:=1 to n do
                for t:=1 to j do
                        begin
                        inc(res[i,j+1,1],res[i-1,j,t]);
                        inc(res[i,max(j,t+1),t+1],res[i-1,j,t]);
                        end;
        for j:=i-2 downto 1 do
                for t:=1 to n do
                        for u:=1 to t do
                                for v:=1 to n do
                        inc(res[i,max(t,u+v+1),u+1],res[j,t,u]*a[i-1-j,v]);
        for j:=1 to n do
                for t:=1 to n do
                        a[i,j]:=a[i,j]+res[i,j,t];
        end;
for i:=k to n do kq:=kq+a[n,i];
writeln(kq);
end.

program D_trees_1;
//{$DEFINE D}
{$APPTYPE CONSOLE}
{$O-,R+,Q+}
uses
  SysUtils, Math;

var
    i, n, h: integer;
    start: extended;
    ans: array [0..100,0..100] of int64;
    res: int64;

function f(n, h: integer): int64;
var
    i: integer;
    hl, hr: integer;
begin
    if ans[n, h] > -1 then
        begin
            result := ans[n, h];
            exit
        end;
    if h > n then
        begin
            result  := 0;
            ans[n, h] := 0;
            exit
        end; //}
    result := 0;
    for i  := 0 to n - 1 do
        for hl := 0 to h - 1 do
            for hr := 0 to h - 1 do
                if max(hl, hr) = h - 1 then
                    result := result + f(i, hl)*f(n - i - 1, hr);
    ans[n, h] := result
end;

begin
{$IFDEF D}
    reset(input,'in');
    rewrite(output,'out');
{$ENDIF}
    start := now;
    read(n, h);

    fillchar(ans, sizeof(ans), 255);
    fillchar(ans[0], sizeof(ans[0]), 0);
    ans[0][0] := 1;
    ans[1, 1] := 1;

    res := 0;
    for i := h to n do res := res + f(n, i);
    writeln(res)
end.

{$R-,S-,Q-,I-,O-}
{$M 32000000}

{$APPTYPE CONSOLE}

uses Math;
const
inf = round(1e9);
maxn = round(1e5) + 200;
md = round(1e9) + 7;
var
n,h,i,j,k,root : longint;
dp : array [0..55,0..55] of int64;
ans : int64;
begin
 //reset (input,'input.txt');
 //rewrite (output,'output.txt');
 randomize;
 readln(n,h);
 fillchar(dp,sizeof(dp),0);
 dp[0][0]:=1;
 for i:=1 to n do
  for j:=1 to n do
   for root:=1 to i do
   begin
    for k:=0 to j - 1 do dp[i][j]:=(dp[i][j] + dp[root - 1][j - 1] * dp[i - root][k]);
    for k:=0 to j - 2 do dp[i][j]:=(dp[i][j] + dp[root - 1][k] * dp[i - root][j - 1]);
   end;
 ans:=0;
 for i:=h to n do ans:=(ans + dp[n][i]);
 writeln(ans);
end.

{$M 10000000,0,10000000}
var i,j,l,n,h:longint;
a:array[0..40,0..40,0..40,0..1]of int64;

function run(l,r,hi,st:longint):int64;
var tmp:int64;
i:longint;
  begin
   if (a[l,r,hi,st]<>-1) then
     begin
      run:=a[l,r,hi,st];
      exit;
     end;

   if (l=r)and(((hi>=h)and(st=1))or(st=0)) then
     begin
      run:=1;
      exit
     end;

   if (l=r) then
     begin
      run:=0;
      exit;
     end;

   tmp:=0;
   for i:=l+1 to r-1 do
    begin
     if st=1 then
      begin
     tmp:=tmp+run(l,i-1,hi+1,0)*run(i+1,r,hi+1,1);
     tmp:=tmp+run(l,i-1,hi+1,1)*run(i+1,r,hi+1,0);
     tmp:=tmp-run(l,i-1,hi+1,1)*run(i+1,r,hi+1,1);
      end
       else
           tmp:=tmp+run(l,i-1,hi+1,0)*run(i+1,r,hi+1,0);
    end;

   tmp:=tmp+run(l,r-1,hi+1,st) + run(l+1,r,hi+1,st);

   a[l,r,hi,st]:=tmp;

   run:=tmp;
  end;

 begin
  read(n,h);

  for i:=0 to n do
    for j:=0 to n do
      for l:=0 to n do
       begin
        a[i,j,l,0]:=-1;
        a[i,j,l,1]:=-1;
       end;

  writeln(run(1,n,1,1));
 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}
//{$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}

program ProblemD;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Math;

const
  inname = 'input.txt';
  outname = 'output.txt';
  maxn = 38;
  maxm = 0;
  inf = maxlongint div 2;
  eps = 0;

type
  int = longint;
  bool = boolean;
  real = extended;

var
  n, h, ans: int64;
  a: array[0..maxn,0..maxn] of int64;

function calc(n, h: int64): int64;
var
  i, j: int;
  d, l, r, ls, rs: int64;
begin
  if (a[n, h] <> - 1) then begin
    result := a[n, h];
    exit;
  end;

  if (n = 0) or (h = 0) then begin
    result := 0;
    exit;
  end;

  d := 0;
  for i := 1 to n do begin
    l := calc(i - 1, h - 1);
    rs := 0;
    if (l > 0) then
      for j := 0 to h - 1 do
        rs := rs + calc(n - i, j);
    r := calc(n - i, h - 1);
    ls := 0;
    if (r > 0) then
      for j := 0 to h - 1 do
        ls := ls + calc(i - 1, j);

    d := d  - r*l + l*rs + ls*r;
  end;

  a[n, h] := d;
  result := d;
end;

procedure run;
var
  i: int;
begin
  fillchar(a, sizeof(a), -1);
  a[0, 0] := 1;

  read(n, h);

  ans := 0;

  for i := h to n do
    ans := ans + calc(n, i);

  write(ans);
end;

procedure openfiles;
begin
  assign(input, inname);
  assign(output, outname);
  reset(input);
  rewrite(output);
end;

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

Begin
  //openfiles;
  run;
  //closefiles;
End.

var i,j,l,n,h:longint;
a:array[0..40,0..40,0..40,0..1] of int64;

function work(l,r,z,kind:longint):int64;
var i:longint;
x:int64;
begin
if (a[l,r,z,kind]<>-1) then exit(a[l,r,z,kind]);
if (l=r)  then
if ((z>=h) and (kind=1)) or (kind=0) then exit(1) else exit(0);

x:=0;
for i:=l+1 to r-1 do
begin
if kind=1 then
begin
inc(x,work(l,i-1,z+1,0)*work(i+1,r,z+1,1));
inc(x,work(l,i-1,z+1,1)*work(i+1,r,z+1,0));
dec(x,work(l,i-1,z+1,1)*work(i+1,r,z+1,1));
end
else inc(x,work(l,i-1,z+1,0)*work(i+1,r,z+1,0));
end;

inc(x,work(l,r-1,z+1,kind)+work(l+1,r,z+1,kind));

a[l,r,z,kind]:=x;
exit(x);
end;

begin
read(n,h);

for i:=0 to n do for j:=0 to n do for l:=0 to n do
begin
a[i,j,l,0]:=-1;a[i,j,l,1]:=-1;
end;

writeln(work(1,n,1,1));
end.

var
        n                       :longint;
        h                       :longint;
        f                       :array[0..110,0..110] of int64;
        i,j,k,l                 :longint;
        ans                     :int64;
begin
    read(n,h);
    f[0,0]:=1;
    for i:=1 to n do
    begin
        for j:=1 to n do
        begin
            for k:=0 to i-1 do
            begin
                for l:=0 to j-2 do f[i,j]:=f[i,j]+2*f[k,j-1]*f[i-k-1,l];
            end;
            for k:=0 to i-1 do
            begin
                f[i,j]:=f[i,j]+f[k,j-1]*f[i-k-1,j-1];
            end;
        end;
    end;
    for i:=h to n do
    begin
        ans:=ans+f[n,i];
    end;
    writeln(ans);
end.

program D;
var a:array[0..35,0..35] of qword;
    i,j,k,l,n,h:longint;
    s:qword;
begin
//  assign(input,'D.in');reset(input);
//  assign(output,'D.out');rewrite(output);
  readln(n,h);
  fillchar(a,sizeof(a),0);a[1,1]:=1;a[0,0]:=1;
  for i:=2 to n do
    for j:=1 to i do
      for k:=0 to i-1 do
        begin
          for l:=0 to j-1 do inc(a[i,j],a[k,l]*a[i-k-1,j-1]);
          for l:=0 to j-2 do inc(a[i,j],a[i-k-1,l]*a[k,j-1]);
        end;
  s:=0;for i:=h to n do inc(s,a[n,i]);
  writeln(s);
//  close(input);close(output);
end.

var
  i,j,k,h:longint;
  m,n:int64;
  f:array[0..40,0..40]of int64;
begin
  readln(n,h);
  for i:=0 to n do
    f[0,i]:=1;
  for i:=1 to n do
    for j:=1 to n do
      for k:=0 to j-1 do
        f[j,i]:=f[j,i]+f[k,i-1]*f[j-k-1,i-1];

  writeln(f[n,n]-f[n,h-1]);
end.

var
	n,m,i,j,k								:longint;
	f										:array[0..50,0..50] of int64;
begin
	read(n,m);
	for i:=0 to n do f[0,i]:=1;
	for i:=1 to n do
	for j:=1 to n do
	for k:=0 to i-1 do
		f[i,j]:=f[i,j]+f[k,j-1]*f[i-k-1,j-1];
	writeln(f[n,n]-f[n,m-1]);
end.

{$r-,q-,s-,i-,o+}
var
  res                : int64;
  n, h, qn, qh, i, j : longint;
  f                  : array [0..40, 0..40] of int64;

begin
  read(n, h);
  fillchar(f, sizeof(f), $0);
  f[0][0] := 1;
  f[1][1] := 1;
  for qh:=2 to n do
    for qn:=2 to n do begin
      for i:=0 to qn-1 do
        for j:=0 to qh-1 do
          f[qn][qh] := f[qn][qh] + f[i][j] * f[qn-i-1][qh-1];
      for i:=0 to qn-1 do
        for j:=0 to qh-2 do
          f[qn][qh] := f[qn][qh] + f[i][j] * f[qn-i-1][qh-1];
    end;
  res := 0;
  for i:=h to n do inc(res, f[n][i]);
  writeln(res);
end.

  var
    f:array[0..35,0..35]of int64;
    n,h,i,j,k,l:longint;
    s,t:int64;

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

  begin
    readln(n,h);
    f[0,0]:=1;
    for i:=1 to n do
      for j:=1 to i do
      begin
        t:=0;
        for k:=0 to i-1 do
        begin
          s:=0;
          for l:=0 to min(j-1,i-k-1) do
            inc(s,f[i-k-1,l]);
          inc(t,f[k,j-1]*s*2);
        end;
        for k:=0 to i-1 do dec(t,f[k,j-1]*f[i-k-1,j-1]);
        f[i,j]:=t;
      end;
    t:=0;
    for i:=h to n do inc(t,f[n,i]);
    writeln(t);
  end.

const
        fi='';
        fo='';
var
        nm,h:longint;
        res:int64;
        A:array[0..60,0..60] of int64;
        f:Text;
procedure nhap;
begin
        assign(f,fi);
        reset(f);
        readln(f,nm,h);
        close(f);
end;
procedure xuat;
begin
        assign(f,fo);
        rewrite(f);
        writeln(f,res);
        close(F);
end;
procedure process;
var n,i,cao,j:longint;
begin
        fillchar(A,sizeof(A),0);
        A[0,0]:=1;
        for n:=1 to nm do
        for cao:=1 to n do
        for i:=1 to n do
         begin
                for j:=0 to cao-1 do A[n,cao]:=A[n,cao]+A[i-1,cao-1]*A[n-i,j];
                for j:=0 to cao-2 do A[n,cao]:=A[n,cao]+A[i-1,j]*A[n-i,cao-1];
         end;
        res:=0;
        for i:=h to nm do res:=res+A[nm,i];
end;
begin
        nhap;
        process;
        xuat;
end.

Program LL;
Var
    f:array[0..1000,0..1000] of int64;
	i,j,k,m,n:longint;
	ans,tot,sum:int64;
Begin
		readln(n,m);
		for i:=0 to n do
		begin
		 f[0,i]:=1;
		end;
		for k:=1 to n do
		 for i:=1 to n do
		  begin
		     f[i,k]:=0;
			 for j:=0 to i-1 do
			    f[i,k]:=f[i,k]+f[j,k-1]*f[i-j-1,k-1];
		  end;
		writeln(f[n,n]-f[n,m-1]);
End.

Const
        fi = '';
        fo = '';
        MaxN = 40;

Type    Arr1 = Array[0..MaxN+1,0..MaxN+1] Of Qword;

Var     f : Arr1;
        n, h, i, j, k, l : Longint;
        kq : Qword;

Function minh(x : longint) : longint;
 Var    y, k : longint;
 Begin
        y := 1;
        k := 1;
        x := x-1;
        while x > 0 do
        begin
                y := y*2;
                x := x-y;
                inc(k);
        end;
        exit(k);
 End;

Begin
        read(n,h);
        //////
        f[0,0] := 1;
        f[1,1] := 1;
        ///////
        for i := 2 to n do
        for j := minh(i) to n do
        begin
                for k := 0 to i-1 do
                begin
                        for l := 0 to j-2 do
                        f[i,j] := f[i,j] + f[k,j-1]*f[i-1-k,l] + f[k,l]*f[i-1-k,j-1];
                        f[i,j] := f[i,j] + f[k,j-1]*f[i-1-k,j-1];
                end;

        end;
        /////
        kq := 0;
        for i := h to n do
                kq := kq + f[n,i];
        writeln(kq);
End.

uses math;
var  n,h:longint;
     a:array[0..39,0..39]of int64;
     res:int64;

procedure qhd;
var  i,j,k,t,l:longint;
begin
     a[0,0]:=1;
     for i:=1 to n do
     for j:=1 to i do
        for k:=0 to i-1 do
            for t:=0 to min(k,j-1) do
            for l:=0 to min(i-k-1,j-1) do
                if (t=j-1) or (l=j-1) then
                a[i,j]:=a[i,j] + a[k,t]*a[i-k-1,l];
end;

procedure demkq;
var  i:longint;
begin
     res:=0;
     for i:=h to n do res:=res+a[n,i];
end;

begin
     readln(n,h);
     qhd;
     demkq;
     writeln(res);
end.

uses math;
var  n,h:longint;
     a:array[0..40,0..40]of int64;
     res:int64;

procedure qhd;
var  i,j,k,t,l:longint;
begin
     a[0,0]:=1;
     for i:=1 to n do
     for j:=1 to i do
        for k:=0 to i-1 do
            for t:=0 to min(k,j-1) do
            for l:=0 to min(i-k-1,j-1) do
                if (t=j-1) or (l=j-1) then
                a[i,j]:=a[i,j] + a[k,t]*a[i-k-1,l];
end;

procedure demkq;
var  i:longint;
begin
     res:=0;
     for i:=h to n do res:=res+a[n,i];
end;

begin
     readln(n,h);
     qhd;
     demkq;
     writeln(res);
end.

var
 i,j,k,q,l:longint;
 ans:int64;
 f:array[0..100,0..100] of int64;
 n,h:longint;
function min(a,b:longint):longint;
begin
 if a>b then exit(b);
 exit(a);
end;

begin
 readln(n,h);
 f[0,0]:=1;
 for i:=1 to n do
  for j:=1 to i do
   for k:=0 to i-1 do
    for q:=0 to min(k,j-1) do
     for l:=0 to min(i-k-1,j-1) do
      if (q=j-1) or (l=j-1) then
       f[i,j]:=f[i,j]+f[k,q]*f[i-k-1,l];
 for i:=h to n do
  ans:=ans+f[n,i];
 writeln(ans);
end.

var i,j,n,m,k,s,l:longint;
o:int64;
f:Array[0..100,0..100,0..100] of int64;
function aaa(x,y:longint):int64;
var s1:int64;
i1,j1,cnt:longint;
begin
  cnt:=0;
  if x>y then exit(0);
  s1:=1;
  for i1:=x+1 to y do begin
  s1:=s1*i1;
  inc(cnt);
  s1:=s1 div cnt;end;
  exit(s1);
end;
begin
  readln(n,m);
  f[1,1,1]:=1;
  for j:=1 to n do
  begin
    for k:=1 to n do
    for l:=1 to n do
    for i:=1 to n do
    f[i+l,j+1,l]:=f[i+l,j+1,l]+aaa(l,2*k)*f[i,j,k];
  end;
  o:=0;
  for i:=1 to n do
  for j:=m to n do
  o:=o+f[n,j,i];
  writeln(o);
end.

var
  f:array[0..1001,0..1001] of int64;
  i,j,k,n,h:longint;
begin
  readln(n,h);
  for i:=0 to n do f[0,i]:=1;
  for i:=1 to n do
    for j:=1 to n do
      for k:=0 to i-1 do
        f[i,j]:=f[i,j]+f[k,j-1]*f[i-k-1,j-1];
  writeln(f[n,n]-f[n,h-1]);
end.

var f:array[0..35,0..35] of int64;
    k,l,i,j,n,m:longint;
    ans:int64;
     begin
      readln(n,m);
      f[0][0]:=1;
      for i:=1 to n do
      for j:=1 to i do
      for k:=1 to n do
       begin
        for l:=0 to j-1 do inc(f[i][j],f[k-1][j-1]*f[i-k][l]);
        for l:=0 to j-2 do inc(f[i][j],f[i-k][j-1]*f[k-1][l]);
       end;
     for i:=m to n do inc(ans,f[n][i]);
     writeln(ans);
 end.

uses math;
const
        nmax    =       100;
var
        n,h:longint;
        res:qword;
        f:array[0..35,0..35] of qword;
procedure progress;
var i,j,u,v,t:longint;
begin
        read(n,h);
        f[0][0]:=1;
        f[1][1]:=1;
        for i:=2 to n do for j:=1 to i do
            for u:=0 to i-1 do for t:=0 to j-1 do
             begin
              f[i][j]:=f[i][j]+f[u][j-1]*f[i-1-u][t];
              if t<j-1 then f[i][j]:=f[i][j]+f[u][t]*f[i-1-u][j-1];
             end;
        for i:=h to n do res:=res+f[n][i];
        writeln(res);
end;
begin
        assign(input,'');reset(input);
        assign(output,'');rewrite(output);
          progress;
        close(input);
        close(output);
end.

var f:array[0..100,0..100] of qword;
    i,j,k,n,h:longint;
    ans:qword;
begin
  readln(n,h);
  for i:=0 to n do f[0,i]:=1;
  for k:=1 to n do
   for i:=1 to n do
    begin
      f[i,k]:=0;
      for j:=0 to i-1 do
       f[i,k]:=f[i,k]+f[j,k-1]*f[i-j-1,k-1];
    end;
  ans:=f[n,n]-f[n,h-1];
  writeln(ans);
end.

uses math;
const
        fi='';
var
        g:array [0..35,0..35] of int64;
        n,k:longint;
        kq:int64;
        f:text;
procedure nhap;
begin
        assign(f,fi);
        reset(f);
        readln(f,n,k);
        close(f);
end;
procedure xuly;
var
        i,j,u,v:longint;
begin
        kq:=0;
        g[0,0]:=1; g[1,1]:=1;
        for i:=2 to n do
        for j:=2 to i do
        begin
                for u:=i-1 downto j-1 do
                for v:=j-2 downto 0 do g[i,j]:=g[i,j]+g[u,j-1]*g[i-u-1,v];
                g[i,j]:=g[i,j]*2;
                for u:=i-1 downto j-1 do g[i,j]:=g[i,j]+g[u,j-1]*g[i-u-1,j-1];
        end;
        for i:=k to n do kq:=kq+g[n,i];
        writeln(kq);
end;
begin
        nhap;
        xuly;
end.

uses math;
const
        fi='';
var
        n,k:longint;
        kq:int64;
        g:array [0..35,0..35] of int64;
        f:text;
procedure nhap;
begin
        assign(f,fi);
        reset(f);
        readln(f,n,k);
        kq:=0;
        close(f);
end;
procedure xuly;
var
        i,j,u,v:longint;
begin
        fillchar(g,sizeof(g),0);
        g[0,0]:=1; g[1,1]:=1;
        for i:=2 to n do
        for j:=2 to i do
        begin
                for u:=i-1 downto j-1 do
                for v:=j-2 downto 0 do g[i,j]:=g[i,j]+g[u,j-1]*g[i-u-1,v];
                g[i,j]:=g[i,j]*2;
                for u:=i-1 downto j-1 do g[i,j]:=g[i,j]+g[u,j-1]*g[i-u-1,j-1];
        end;

        for i:=k to n do kq:=kq+g[n,i];
        writeln(kq);
end;
begin
        nhap;
        xuly;
end.

uses math;
var i,j,n,m,k,o,s:longint;
a:array[0..100,0..100] of int64;
begin
  readln(n,m);
  for i:=0  to n do
  a[0,i]:=1;
  for i:=1 to n do
  for j:=1 to n do
  for k:=0 to j-1 do
  a[j,i]:=a[j,i]+a[k,i-1]*a[j-k-1,i-1];
  writeln(a[n,n]-a[n,m-1]);
end.

var
   f:array[0..35,0..35]of int64;
   i,j,x,n,h:longint;

begin
  readln(n,h);
  fillchar(f,sizeof(f),0);
  for i:=0 to n do
    f[0,i]:=1;
  for i:=1 to n do
    for j:=1 to n do
      for x:=0 to j-1 do
        inc(f[j,i],f[x,i-1]*f[j-x-1,i-1]);
  writeln(f[n,n]-f[n,h-1]);
end.

program P9D;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes
  { you can add units after this };

var
  T: array [0..35, 0..35] of Int64;
  n, h: Integer;

function Compute (n, h: Integer): Int64;
var
  i, m: Integer;
  Tmp: Int64;

begin
  if 0<= T [n, h] then
    Exit (T [n, h]);

  if n= 0 then
    if h= 0 then
      Exit (1)
    else
      Exit (0);

  if h< 0 then
    Exit (0);
  if h= 0 then
    Exit (0);
  if n< h then
    Exit (0);

  Result:= 0;

  for m:= 1 to n do
    for i:= 0 to h- 1 do
      Result+= Compute (m- 1, h- 1)*
               Compute (n- m, i);

  for m:= 1 to n do
    for i:= 0 to h- 2 do
      Result+= Compute (m- 1, i)*
               Compute (n- m, h- 1);

  T [n, h]:= Result;

end;

var
  i, j: Integer;
  Sum: Int64;

begin
  FillChar (T, SizeOf (T), 255);

  ReadLn (n, h);
  Sum:= 0;
  for i:= h to n do
    Sum+= Compute (n, i);

  WriteLn (Sum);
end.

const
 m = 35;

var
 f: array[0..m, 0..m] of int64;
 i, j: integer;

 a: array[0..m, 0..m, 0..m] of int64;
 lvl, le0, le1, nod: integer;
 n, h: integer;
 s: int64;

begin

 {f(k,n) - binary}
 f[0,0] := 1;
 for i := 1 to m do
  begin
  f[i,0] := 0;
  f[i,1] := 0;
  f[0,i] := 1;
  f[1,i] := 2*i;
  end;
 f[1,1] := 2;
 f[2,1] := 1;
 for i := 2 to m do
 for j := 2 to m do
  f[i,j] := f[i, j-1] + 2*f[i-1, j-1] + f[i-2, j-1];

 read(n, h);

 {level, nodes, leaves}
 for lvl := 0 to m do
 for nod := 0 to m do
 for le0 := 0 to m do
  a[lvl, nod, le0] := 0;

 a[1, 1, 1] := 1;

 for lvl := 1 to m-1 do
 for nod := 1 to n do
 for le0 := 1 to n do
 for le1 := 1 to n - nod do
  a[lvl + 1, nod + le1, le1] += f[le1, le0] * a[lvl, nod, le0];

 s := 0;
 for lvl := h to n do
 for le0 := 1 to n do
 s += a[lvl, n, le0];

 write(s);
end.

Program cfD(input,output);
Var
  i,j,k,m,n:Longint;
  f:array[0..1000,0..1000] of Int64;
//-----------------------------
Begin
  readln(n,m);
  for i:=0 to n do f[0,i]:=1;
  for k:=1 to n do
    for i:=1 to n do
	  begin
	  f[i,k]:=0;
	  for j:=0 to i-1 do
	    f[i,k]:=f[i,k]+f[j,k-1]*f[i-j-1,k-1];
	  end;
  writeln(f[n,n]-f[n,m-1]);
End.

Program Cfd;  //By Ro_mantic

Var i,j,k,n,m,h:longint;
    ans:Int64;
    F,sum:array[0..100,0..100]of Int64;

Begin
 read(n,h);
 F[0,0]:=1; F[1,1]:=1;
 sum[0,0]:=1; sum[1,1]:=1;
 for i:=1 to n do
  begin
   sum[0,i]:=1;
   sum[1,i]:=1;
  end;
 for i:=2 to n do
  for j:=2 to n do
   begin
    for k:=0 to i-1 do
     F[i,j]:=F[i,j]+F[k,j-1]*sum[i-k-1,j-1]+F[i-k-1,j-1]*sum[k,j-2];
    sum[i,j]:=sum[i,j-1]+F[i,j];
   end;
 {for i:=1 to n do
  begin
   for j:=1 to n do
    write(sum[i,j],' ');
   writeln;
  end;}
 for i:=h to n do
  ans:=ans+F[n,i];
 writeln(ans);
End.

{$M 10000000,0,10000000}
var i,j,l,n,h:longint;
a:array[0..40,0..40,0..40]of int64;
function run(l,r,hi:longint):int64;
var tmp:int64;
i:longint;
  begin
   if (a[l,r,hi]<>-1) then
     begin
      run:=a[l,r,hi];
      exit;
     end;

   if (l=r)and(hi>=h) then
     begin
      a[l,r,hi]:=1;
      run:=1;
      exit
     end;

   if (l=r) then
     begin
      run:=0;
      exit;
     end;

   tmp:=0;
   for i:=l+1 to r-1 do
     tmp:=tmp+run(l,i-1,hi+1)*run(i+1,r,hi+1);

   tmp:=tmp+run(l,r-1,hi+1) + run(l+1,r,hi+1);

   a[l,r,hi]:=tmp;

   run:=tmp;
  end;

 begin
  read(n,h);

  for i:=0 to n do
    for j:=0 to n do
      for l:=0 to n do
        a[i,j,l]:=-1;

  writeln(run(1,n,1));
 end.

uses math;
var i,j,n,m,k,o,s:longint;
a:array[0..100,0..100] of longint;
begin
  readln(n,m);
  for i:=0  to n do
  a[0,i]:=1;
  for i:=1 to n do
  for j:=1 to n do
  for k:=0 to j-1 do
  a[j,i]:=a[j,i]+a[k,i-1]*a[j-k-1,i-1];
  writeln(a[n,n]-a[n,m-1]);
end.

{$r-,q-,s-,i-,o+}
var
  res                : int64;
  n, h, qn, qh, i, j : longint;
  f                  : array [0..40, 0..40] of int64;

begin
  read(n, h);
  fillchar(f, sizeof(f), $0);
  f[0][0] := 1;
  f[1][1] := 1;
  for qh:=2 to n do
    for qn:=2 to n do begin
      for i:=0 to qn-1 do
        for j:=0 to qn-1 do begin
          f[qn][qh] := f[qn][qh] + 2*f[i][j] * f[qn-i-1][qh-1];
          if (i = qn-i-1) and (j = qh-1)
            then dec(f[qn][qh], f[i][j] * f[qn-i-1][qh-1]);
        end;

    end;
  res := 0;
  for i:=h to n do inc(res, f[n][i]);
  writeln(res);
end.

  var
    f:array[0..35,0..35]of int64;
    n,h,i,j,k:longint;
    t:int64;

  begin
    readln(n,h);
    for i:=0 to n do f[0,i]:=1;
    for i:=1 to n do
      for j:=1 to i do
      begin
        t:=0;
        for k:=0 to i-1 do inc(t,f[k,j-1]*f[i-k-1,j-1]);
        f[i,j]:=t;
      end;
    t:=0;
    for i:=h to n do inc(t,f[n,i]);
    writeln(t);
  end.

Program LL;
Var
    f:array[0..1000,0..1000] of longint;
	i,j,k,m,n:longint;
	ans,tot,sum:int64;
Begin
		readln(n,m);
		for i:=0 to n do
		begin
		 f[0,i]:=1;
		end;
		for k:=1 to n do
		 for i:=1 to n do
		  begin
		     f[i,k]:=0;
			 for j:=0 to i-1 do
			    f[i,k]:=f[i,k]+f[j,k-1]*f[i-j-1,k-1];
		  end;
		writeln(f[n,n]-f[n,m-1]);
End.

Const
        fi = '';
        fo = '';
        MaxN = 40;

Type    Arr1 = Array[0..MaxN+1,0..MaxN+1] Of Qword;

Var     f : Arr1;
        n, h, i, j, k, l : Longint;
        kq : Qword;

Begin
        read(n,h);
        //////
        f[0,0] := 1;
        f[1,1] := 1;
        ///////
        for i := 2 to n do
        for j := 1 to n do
        begin
                for k := 0 to i-1 do
                for l := 0 to j-1 do
                        f[i,j] := f[i,j] + f[k,j-1]*f[i-1-k,l] + f[k,l]*f[i-1-k,j-1];
                if (i-1)mod 2 = 0 then
                        f[i,j] := f[i,j] - f[(i-1)div 2,j-1]*f[(i-1)div 2,j-1];
        end;
        /////
        kq := 0;
        for i := h to n do
                kq := kq + f[n,i];
        writeln(kq);
End.

var
 a,b,f,w,p:array[0..5001]of longint;
 n,tot,i,k,j,pp,ans:longint;

procedure sort(l,r:longint);
var i,j,m1,m2,t:longint;
begin
 i:=l; j:=r; m1:=a[(l+r)shr 1]; m2:=b[(l+r)shr 1];
 repeat
  while (a[i]<m1) or (a[i]=m1) and (b[i]>m2) do inc(i);
  while (m1<a[j]) or (a[j]=m1) and (m2>b[j]) do dec(j);
  if i<=j then
  begin
   t:=a[i]; a[i]:=a[j]; a[j]:=t;
   t:=b[i]; b[i]:=b[j]; b[j]:=t;
   t:=w[i]; w[i]:=w[j]; w[j]:=t;
   inc(i);
   dec(j);
  end;
 until i>j;
 if l<j then sort(l,j);
 if i<r then sort(i,r);
end;

begin
 readln(n,a[0],b[0]);
 for i:=1 to n do
 begin
  readln(a[i],b[i]);
  w[i]:=i;
 end;
 sort(1,n);
 for i:=n downto 0 do
 begin
  if (a[i]>a[0])or(a[i]=a[0])and(b[i]<b[0]) then
  begin
   a[i+1]:=a[i];
   b[i+1]:=b[i];
   w[i+1]:=w[i];
  end
  else break;
 end;
 a[i+1]:=a[0]; b[i+1]:=b[0];
 fillchar(f,sizeof(f),192);
 f[i+1]:=0;
 ans:=-maxlongint;
 k:=i+1;
 for i:=k+1 to n+1 do
 for j:=k to i-1 do
 if b[i]>b[j] then
 begin
  if f[j]+1>f[i] then
  begin
   f[i]:=f[j]+1;
   p[i]:=j;
  end;
  if f[i]>ans then
  begin
   ans:=f[i];
   pp:=i;
  end;
 end;
 if ans>0 then
 begin
  writeln(ans);
  while pp<>k do
  begin
   inc(tot);
   a[tot]:=w[pp];
   pp:=p[pp];
  end;
  for i:=tot downto 2 do
   write(a[i],' ');
  writeln(a[1]);
 end
 else writeln(0);
end.

var i,j,n,m,k,s,l:longint;
o:int64;
f:Array[0..100,0..100,0..100] of int64;
function aaa(x,y:longint):int64;
var s1:int64;
i1,j1:longint;
begin
  if x>y then exit(0);
  s1:=1;
  for i1:=x+1 to y do
  s1:=s1*i1;
  for i1:=2 to (y-x) do
  s1:=s1 div i1;
  exit(s1);
end;
begin
  readln(n,m);
  f[1,1,1]:=1;
  for j:=1 to n do
  begin
    for k:=1 to n do
    for l:=1 to n do
    for i:=1 to n do
    f[i+l,j+1,l]:=f[i+l,j+1,l]+aaa(l,2*k)*f[i,j,k];
  end;
  o:=0;
  for i:=1 to n do
  for j:=m to n do
  o:=o+f[n,j,i];
  writeln(o);
end.

var i,j,n,m,k,s,l:longint;
o:int64;
f:Array[0..100,0..100,0..100] of int64;
function aaa(x,y:longint):int64;
var s1:int64;
i1,j1:longint;
begin
  s1:=1;
  for i1:=x+1 to y do
  s1:=s1*i1;
  for i1:=2 to (y-x) do
  s1:=s1 div i1;
  exit(s1);
end;
begin
  readln(n,m);
  f[1,1,1]:=1;
  for j:=1 to n do
  begin
    for i:=1 to n do
    for k:=1 to n do
    for l:=1 to n do
    f[i+l,j+1,l]:=f[i+l,j+1,l]+aaa(l,2*k)*f[i,j,k];
  end;
  o:=0;
  for i:=1 to n do
  for j:=m to n do
  o:=o+f[n,j,i];
  writeln(o);
end.

var i,j,n,m,k,s,l:longint;
o:int64;
f:Array[0..100,0..100,0..100] of int64;
function aaa(x,y:longint):int64;
var s1:int64;
i1,j1:longint;
begin
  s1:=1;
  for i1:=x+1 to y do
  s1:=s1*i1;
  for i1:=2 to (y-x) do
  s1:=s1 div i1;
  exit(s1);
end;
begin
  readln(n,m);
  f[1,1,1]:=1;
  for j:=1 to n do
  begin
    for k:=1 to n do
    for l:=1 to n do
    for i:=1 to n do
    f[i+l,j+1,l]:=f[i+l,j+1,l]+aaa(l,2*k)*f[i,j,k];
  end;
  o:=0;
  for i:=1 to n do
  for j:=m to n do
  o:=o+f[n,j,i];
  writeln(o);
end.

var
  f:array[0..1001,0..1001] of longint;
  i,j,k,n,h:longint;
begin
  readln(n,h);
  for i:=0 to n do f[0,i]:=1;
  for i:=1 to n do
    for j:=1 to n do
      for k:=0 to i-1 do
        f[i,j]:=f[i,j]+f[k,j-1]*f[i-k-1,j-1];
  writeln(f[n,n]-f[n,h-1]);
end.

uses math;
const
        nmax    =       100;
var
        n,h:longint;
        res:qword;
        f:array[0..35,0..35] of qword;
procedure progress;
var i,j,u,v,t:longint;
begin
        read(n,h);
        f[0][0]:=1;
        f[1][1]:=1;
        for i:=2 to n do for j:=1 to h do
            for u:=0 to i-1 do for t:=0 to j-1 do
             begin
              f[i][j]:=f[i][j]+f[u][j-1]*f[i-1-u][t];
              if t<j-1 then f[i][j]:=f[i][j]+f[u][t]*f[i-1-u][j-1];
             end;
        for i:=h to n do res:=res+f[n][i];
        writeln(res);
end;
begin
        assign(input,'');reset(input);
        assign(output,'');rewrite(output);
          progress;
        close(input);
        close(output);
end.

var
   f:array[0..35,0..35]of longint;
   i,j,x,n,h:longint;

begin
  readln(n,h);
  fillchar(f,sizeof(f),0);
  for i:=0 to n do
    f[0,i]:=1;
  for i:=1 to n do
    for j:=1 to n do
      for x:=0 to j-1 do
        inc(f[j,i],f[x,i-1]*f[j-x-1,i-1]);
  writeln(f[n,n]-f[n,h-1]);
end.

Program cfD(input,output);
Var
  ans:Int64;
  i,j,k,t,m,n,h:Longint;
  f:array[0..35] of Int64;
  b:array[0..35] of boolean;
//-----------------------------
Function Cal(x:longint):int64;
var
  ans:int64;
  i,j,k:Longint;
begin
  if b[x] then exit(f[x]);
  ans:=0;
  for i:=1 to x do
    ans:=ans+cal(i-1)*cal(x-i);
  b[x]:=true;
  f[x]:=ans;
  exit(f[x]);
end;
//-----------------------------
Begin
  readln(n,h);
  f[0]:=1; b[0]:=true;
  f[1]:=1; b[1]:=true;
  f[2]:=2; b[2]:=true;
  ans:=0;
  for i:=1 to n do
    begin
	if (i<h) and (n-i<h-1) then continue;
	ans:=ans+cal(i-1)*cal(n-i);
	end;
  writeln(ans);
End.

Program Cfd;  //By Ro_mantic

Var i,j,k,n,m,h:longint;
    ans:Int64;
    F,sum:array[0..100,0..100]of Int64;

Begin
 read(n,h);
 F[0,0]:=1; F[1,1]:=1;
 sum[0,0]:=1; sum[1,1]:=1;
 for i:=1 to n do
  begin
   sum[0,i]:=1;
   sum[1,i]:=1;
  end;
 for i:=2 to n do
  for j:=2 to i do
   begin
    for k:=0 to i-1 do
     F[i,j]:=F[i,j]+F[k,j-1]*sum[i-k-1,j-1]+F[i-k-1,j-1]*sum[k,j-2];
    sum[i,j]:=sum[i,j-1]+F[i,j];
   end;
 {for i:=1 to n do
  for j:=1 to n do
   writeln(i,' ',j,' ',F[i,j]);}
 for i:=h to n do
  ans:=ans+F[n,i];
 writeln(ans);
End.

program D9;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var d: array[0..35, 0..35]of int64;

function dp(n, h: longint): int64;
     var i, k: longint;
begin
  if d[n, h] = -1 then
  begin
    d[n, h] := 0;
    for i := h - 1 to n - 1 do
      for k := 0 to n - 1 - i do
      begin
        d[n, h] := d[n, h] + 2 * dp(i, h - 1) * dp(n - i - 1, k);
        if (i = n - i - 1)and(k = h - i)then d[n, h] := d[n, h] - d[i, k];
      end;
  end;
  result := d[n, h];
end;

var n, h: longint;

function solve: int64;
     var i, j: longint;
begin
  for i := 0 to n do
    for j := 0 to n do
      d[i, j] := -1;
  for i := 0 to 5 do
    for j := 1 shl i to n do
      d[j, i] := 0;
  d[0, 0] := 1;
  for i := 0 to n do
    for j := i + 1 to n do
      d[i, j] := 0;
  d[1, 1] := 1;
  result := 0;
  for i := h to n do
    result := result + dp(n, i);
end;

begin
//reset(input, 'input.txt'); rewrite(output, 'output.txt');
  read(n, h);
  writeln(solve);
  readln; readln;
end.

program D9;

{$APPTYPE CONSOLE}

{$R+}

uses
  SysUtils,
  Math;

var d: array[0..35, 0..35]of int64;

function dp(n, h: longint): int64;
     var i, k: longint;
         a1, a2: int64;
begin
  if d[n, h] = -1 then
  begin
    d[n, h] := 0;
    for i := h - 1 to n - 1 do
      for k := 0 to min(n - 1 - i, h - 1) do
      begin
        a1 := dp(i, h - 1);
        a2 := dp(n - i - 1, k);
        if (i = n - i - 1)and(k = h - 1)then d[n, h] := d[n, h] + a1 * a2
          else d[n, h] := d[n, h] + 2 * a1 * a2;
      end;
  end;
  result := d[n, h];
end;

var n, h: longint;

function solve: int64;
     var i, j: longint;
begin
  for i := 0 to n do
    for j := 0 to n do
      d[i, j] := -1;
  for i := 0 to 5 do
    for j := 1 shl i to n do
      d[j, i] := 0;
  d[0, 0] := 1;
  for i := 0 to n do
    for j := i + 1 to n do
      d[i, j] := 0;
  result := 0;
  for i := h to n do
    result := result + dp(n, i);
end;

begin
//reset(input, 'input.txt'); rewrite(output, 'output.txt');
  read(n, h);
  writeln(solve);
  readln; readln;
end.

{$R-,S-,Q-,I-,O-}
{$M 32000000}

{$APPTYPE CONSOLE}

uses Math;
const
inf = round(1e9);
maxn = round(1e5) + 200;
md = round(1e9) + 7;
var
n,h,i,j,k,root : longint;
dp : array [0..55,0..55] of int64;
ans : int64;
begin
 //reset (input,'input.txt');
 //rewrite (output,'output.txt');
 randomize;
 readln(n,h);
 fillchar(dp,sizeof(dp),0);
 dp[0][0]:=1;
 for i:=1 to n do
  for j:=1 to n do
   for root:=1 to i do
   begin
    for k:=0 to j - 1 do dp[i][j]:=(dp[i][j] + dp[root - 1][j - 1] * dp[i - root][k]) mod md;
    for k:=0 to j - 2 do dp[i][j]:=(dp[i][j] + dp[root - 1][k] * dp[i - root][j - 1]) mod md;
   end;
 ans:=0;
 for i:=h to n do ans:=(ans + dp[n][i]) mod md;
 writeln(ans);
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}
//{$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}

program ProblemD;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Math;

const
  inname = 'input.txt';
  outname = 'output.txt';
  maxn = 38;
  maxm = 0;
  inf = maxlongint div 2;
  eps = 0;

type
  int = longint;
  bool = boolean;
  real = extended;

var
  n, h: int64;
  a: array[0..maxn,0..maxn] of int64;

function calc(n, h: int64): int64;
var
  i, j: int;
  d, l, r, ls, rs: int64;
begin
  if (h < 0) then begin
    result := 0;
    exit;
  end;

  if (a[n, h] <> - 1) then begin
    result := a[n, h];
    exit;
  end;

  if (h > n) then begin
    a[n, h] := 0;
    result := 0;
    exit;
  end;

  if (n = 0) then begin
    a[n, h] := 1;
    result := 1;
    exit;
  end;

  d := 0;
  for i := 1 to n do begin
    l := calc(i - 1, h - 1);
    rs := 0;
    if (l > 0) then
      for j := 0 to h do
        rs := rs + calc(n - i, j);
    r := calc(n - i, h - 1);
    ls := 0;
    if (r > 0) then
      for j := 0 to h do
        ls := ls + calc(i - 1, j);

    d := d  - r*l + l*rs + ls*r;
  end;

  a[n, h] := d;
  result := d;
end;

procedure run;
begin
  fillchar(a, sizeof(a), -1);
  read(n, h);

  write(calc(n, h));
end;

procedure openfiles;
begin
  assign(input, inname);
  assign(output, outname);
  reset(input);
  rewrite(output);
end;

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

Begin
  //openfiles;
  run;
  //closefiles;
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}
//{$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}

program ProblemD;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Math;

const
  inname = 'input.txt';
  outname = 'output.txt';
  maxn = 38;
  maxm = 0;
  inf = maxlongint div 2;
  eps = 0;

type
  int = longint;
  bool = boolean;
  real = extended;

var
  n, h: int64;
  a: array[0..maxn,0..maxn] of int64;

function calc(n, h: int64): int64;
var
  i, j: int;
  d, l, r, ls, rs: int64;
begin
  if (a[n, h] <> - 1) then begin
    result := a[n, h];
    exit;
  end;

  if (n = 0) or (h = 0) then begin
    result := 0;
    exit;
  end;

  d := 0;
  for i := 1 to n do begin
    l := calc(i - 1, h - 1);
    rs := 0;
    if (l > 0) then
      for j := 0 to h do
        rs := rs + calc(n - i, j);
    r := calc(n - i, h - 1);
    ls := 0;
    if (r > 0) then
      for j := 0 to h do
        ls := ls + calc(i - 1, j);

    d := d  - r*l + l*rs + ls*r;
  end;

  a[n, h] := d;
  result := d;
end;

procedure run;
begin
  fillchar(a, sizeof(a), -1);
  a[0, 0] := 1;

  read(n, h);

  write(calc(n, h));
end;

procedure openfiles;
begin
  assign(input, inname);
  assign(output, outname);
  reset(input);
  rewrite(output);
end;

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

Begin
  //openfiles;
  run;
  //closefiles;
End.


var i,j,n,m,k,o,s:longint;
begin
  readln(n,m,k);
  for i:=m to n-1 do
  for j:=k downto 0 do
  if i+j+1=n then inc(o);
  writeln(o);
end.

uses math;
var n,a,b:int64;
begin
  readln(n,a,b);
  writeln(min(n-a,b+1));
end.

var
 n,y,x:longint;
begin
 readln(n,x,y);
 if n-x<=y+1 then writeln(n-x)
             else
 writeln(y+1);
end.

uses math;
var n,a,b:longint;
begin
  read(n,a,b);
  write(min(n-a,b+1));
end.

var
 n,a,b,pas:longint;
begin
 readln(n,a,b);
 a:=a+1;
 while (a<=n) do
 begin
  if n-a<=b then
  begin
   pas:=pas+1;
   a:=a+1;
  end else
  a:=a+1;
 end;
 writeln(pas);
end.

uses math;
var
  n,a,b:longint;
begin
  read(n,a,b);
  writeln(min(n-a,b+1));
end.

var
n,a,b,s:longint;
begin
read(n,a,b);
s:=a+1;
if n-b>s then s:=n-b;
write(n-s+1); end.

var
a,b,n,w,r:int64;
begin
read(n,a,b);
w:=n-a;
r:=b+1;
if w>r then write(r)
else write(w);
end.

var
n,a,b,x:longint;
begin
read(n,a,b);
if n-a<=b+1 then writeln(n-a)
else
writeln(b+1);
end.

uses math;
var a,n,b:longint;
begin
  readln(n,a,b);
  writeln(n-max(a+1,n-b)+1);
end.

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

if n-a>b then
writeln(b+1) else writeln(n-a);
end.

program sher;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var n,a,b:integer;
begin
read(n);
read(a,b);
if (n-a)>(b+1) then
begin
writeln(b+1);
//readln(b);
end
else
writeln(n-a);
//readln(a);
end.

var l,r,a,b,n,s:longint;
begin
read(n,a,b);
s:=0;
for a:=a to n-1 do
if ((n-a-1)<=b) then inc(s);
write(s);
end.

 var     n,a,b,i,dem:longint;
begin
        readln(n,a,b);
        for i:=a+1 to n do
                if n-i<=b then inc(dem);
        writeln(dem);
end.

uses math;
var
  n,a,b,i,s:longint;
 begin
   readln(n,a,b);
   writeln(min(n-a,b+1));
 end.

uses
SySUtils,math;
var n,a,b:integer;
begin
 readln(n,a,b);
 if a+b=n then begin writeln(b);halt;end;
 if a+b<n then begin writeln(b+1);halt;end;
 if a+b>n then begin writeln(n-a);halt;end;
end.

var n,i,a,b,res:longint;
begin
    res:=0;
    readln(n,a,b);
    for i:=1 to n do
        if (i>a)and(i+b>=n) then inc(res);
    writeln(res);
    halt(0);
end.

//Yerzhan Dyussenaliyev
Uses Math, SysUtils;
const
    dx: array [1..4] of longint = (0, 0, -1, 1);
    dy: array [1..4] of longint = (1, -1, 0, 0);
type
	rec = record
		a, b: longint;
	end;
var
	n, a, b, ans, i: longint;

begin
	{$ifndef online_judge}
		reset(input, 'a.in');
		rewrite(output, 'a.out');
	{$endif}

	read(n, a, b);
	ans := 0;
	for i := a + 1 to n do
		if i + b >= n then inc(ans);
	writeln(ans);
end.

{$R+,Q+,I+}
{$apptype console}
Uses SysUtils;
Function Max(a,b:Integer):Integer;
Begin
   If a>b Then Max:=a
          Else Max:=b;
End;
Var
   n,a,b:Integer;
Begin
   Read(n,a,b);
   Write(n-Max(a,n-b-1));
End.

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

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

//type
//T = array [1..110] of Integer;

var
n,a,b,res:longint;
//cc:char;

begin
//reset(input,'input.txt'); rewrite(output,'output.txt');
Read(n,a,b);
if (a+1)>(n-b) then res:=n-a
    else res:=b+1;
Writeln(res);
end.

uses math;
var
 n,a,b,i,s:longint;
begin
  read(n,a,b);
  write(min(n-a,b+1));
end.

var n,a,b:LongInt;
begin
  //reset(input,'input.txt');
  //rewrite(output,'output.txt');
  Readln(n,a,b);
  if (n-a)>(b+1)
  then Writeln(b+1)
  else Writeln(n-a);
end.

{$APPTYPE CONSOLE}
uses
  SysUtils;

var i,n,k,j,ans:integer;

begin
  //reset(input,'input.txt');
  //rewrite(output,'output.txt');
  read(n,k,j);
  ans:=0;
  for i:=1 to n do begin
    if (i-1>=k) and (n-i<=j) then inc(ans);
  end;
  write(ans);
end.

program Project_124_A;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
    n,a,b:Integer;
begin
read(n,a,b);
if((b+1)<(n-a)) then write(b+1) else write(n-a);
read(b);
end.

Var a,b,c:LongInt;
Begin
     Readln (c,a,b);
     c:=c-a;
     If c>b
     then Writeln (b+1)
     else Write (c);
End.

program zadacha124a;
var a,b,n,x:longint;
begin
read(n,a,b);
x:=n-a;
if x-1>b then write(b+1)
else write(x);
end.

program zadacha3;
var a,b,n,x:longint;
begin
read(n,a,b);
x:=n-a;
if x-1>b then write(b+1)
else write(x);
end.

var n,a,b:integer;
function max(a,b:longint):longint;
begin
        if a > b then exit(a)
        else exit(b);
end;
begin
        readln(n,a,b);
        writeln(n-max(a+1,n-b)+1);
        readln;
end.

uses math;
 var n,a,b,q1,q2:longint;
  begin
   read(n,a,b);

    q1:=n-a;
    q2:=b+1;
    writeln(min(q1,q2));
    end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils, math;

var
  n, a, b : integer;

begin
  readln(n, a, b);
  writeln(n - max(a + 1, n - b) + 1);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils,Math;

var
  m,n,a,b:integer;
  i,j,k:integer;
begin
 readln(n,a,b);
 k:=0;
 for i:=1 to n do
    if ((n-i)<=b)and((i-1)>=a) then inc(k);
 write(k);
 readln;
 readln;
 readln;
end.

var i,a,b,n,ans:integer;
begin
readln(n,a,b);
if ((a+1+b)>n) then b:=n-(a+1);
write(b+1);
end.

{$APPTYPE CONSOLE}{$o-}{$r+}

uses
  SysUtils, Math;

var
  n, a, b, i, ans : integer;
begin
  readln(n, a, b);
  for i := a + 1 to n do
  begin
    if n - i <= b then
      inc(ans);
  end;
  write(ans);
end.

program qwe;
{$APPTYPE CONSOLE}
var
    a, b, n: Integer;
begin
    read(n, a, b);
    if (a + b) < n then write(b + 1) else write(n - a);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, a, b, k : integer;

begin
  readln(n, a, b);
  if (1 + a > n - b) then k := 1 + a
    else k := n - b;
  writeln(n - k + 1);
  readln;
end.

{$APPTYPE CONSOLE}
{$R+,Q+,I+}

uses
  SysUtils;

var n,a,b,k:Integer;

begin
  read(n,a,b);
  k:=n-a;
  if k>b+1 then k:=b+1;
  write(k);
  Readln;
  Readln;
end.

var a,b,i,n,j:longint;
 begin
  read (n,a,b);
  for i:=1 to n do
   if (i-1>=a) and (n-i<=b) then inc (j);
 write (j);
end.

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

program N1;
const nmax = 1000*1000;
var i,n,a,b : longint;
begin
  {assign(input,'input.txt'); reset(input);}
  readln(n,a,b);
  if n - a > (b + 1) then writeln(b+1)
                     else writeln(n-a)
end.

Program pos;
Var a,b,n:Integer;
Begin
    read(n);
    read(a);
    read(b);
    n:=n-a;
    if n>b
    then n:=n-(n-b)+1;
    writeln(n);
End.

Uses Math;
var
   n,a,b	:	longint;
begin
//	reset(input, 'a.in');	rewrite(output, 'a.out');
	 read(n,a,b);
	 write(n - (a + (n - min(n,a + 1 + b))));
end.

program fuuu;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Math;
var
 i,  n, m, l, k: longint;

begin
  {assign(input, 'input.txt');
  reset(input);
  assign(output, 'output.txt');
  rewrite(output);
  }read(n, m, k);
  for i :=1  to n do
    if (i>m)and(i>=(n-k)) then inc(l);
  writeln(l);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  list=array[1..1000000]of integer;
var
  i,n,j:Integer;
  g,k:Int64;
  a,b:array[1..1000000] of Integer;
begin
  Readln(n,i,j);
  if (i+1>n-j) then write(n-i)
    else write(j+1);
  Readln;
  Readln;
end.

var
n,a,b:shortint;

Begin
 read(n);read(a);read(b);
 if n-a>=b+1 then write(b+1) else write(n-a);
end.

var n, a, b: longint;
begin
 read(n, a, b);
 if n - a >= b + 1 then writeln(b + 1  ) else
 writeln(n  - a);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  Math, SysUtils;

var
  a, b, n: longint;
begin              {
  reset(input,'input.txt');
  rewrite(output,'output.txt');
                  }
  readln(n, a, b);
  if a >= n then writeln(0) else writeln(min(n - a, b + 1));
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var n,a,b:longint;
function min(a,b:longint):longint;
begin
  if a<b then min:=a else min:=b;

end;

begin
  readln(n,a,b);
  writeln(min(n-a,b+1));
end.

program g;
var n,a,b:byte;
begin
readln(n,a,b);
n:=n-a;
if n>b then writeln(b+1)
       else writeln(n);

//readln;
end.

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

var n,m,k:longint;
  begin
    read(n,m,k);
    n:=n-m;
    if n>k then n:=n-(n-(k+1));
    writeln(n);
  end.

Var A,B,N,I,Res:Longint;
 Begin
  Readln(N,A,B);
  For I:=A To N-1 Do
   If N-I-1<=B Then Inc(Res);
  Writeln(Res);
 End.

var n,a,b:integer;
begin
  read(n,a,b);
  if n-a<b+1 then write(n-a) else write(b+1);
end.

var n,a,b,i,ans:longint;
   begin
    readln(n,a,b);
    for i:=1 to n do
        if (b>=i-1) and (a<=n-i) then inc(ans);
    writeln(ans);
   end.

var
   n,a,b,k,l,m : longint;
begin
  read(n,a,b);
  k:=a+1; l:=n-b;
  if k>l then m:=k else m:=l;
  writeln(n-m+1);
end.

var a,b,n,k: integer;

begin
  readln(n,a,b);
  k:=n-a;
  if k>b+1 then k:=b+1;
  writeln(k);
end.

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

program abc;
var n,a,b:byte;
begin
read(n,a,b);
if (a<n-b) then writeln(b+1);
if (a>=n-b) then writeln(n-a);
end.

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

Var k,i, n,a,b:longint;
begin
readln(n,a,b);
k:=0;
for i:=1 to n do
if (i>=a) and ((n-i)<=(b+1)) then k:=k+1;
if (n=1) then writeln(1) else writeln(k-1);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
    label f;
var n,a,b:integer;
begin
  { TODO -oUser -cConsole Main : Insert code here }
  REad(n,a,b);

  //if (n-b=1)and (a=0) then begin writeln(n);goto f;end;
  if n-a<=b then Writeln(n-a)
  else begin writeln(b+1);

  end;
f: end.

program Project2;

{$APPTYPE CONSOLE}

var
    k,i,n,a,b,c,j,p:integer;
    s1,s2:string;
begin
read(n,a,b);
if n-b-1>a then write(n-(n-b-1)) else write(n-a);
read(a);
end.

{$o-}
var

    i, n, a, b, ans: longint;
begin

 //reset(input, 'a.in');
  //rewrite(output,'a.out');

    read(n, a, b);

    ans := 0;

     For i := 1 to n do
      if (i - 1 >= a) and (n - i  <= b) then inc(ans);
       write(ans);
//    close(input);
//    close(output);
end.

uses math;
var n,a,b,tg:longint;
begin
   readln(n,a,b);
   tg:=n-b;
   writeln( n -max(tg,a+1) +1);
end.

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

program ProjectA;

{$APPTYPE CONSOLE}
{$A+,B-,D+,E+,F+,G-,I+,L+,N+,O-,R+,Q+,S+,V+,X+}

uses
  SysUtils,
  Math;

const
  inf = 1000000000000000000;
//  base = 1000000009;
//  eps = 1e-9;

var
  n, m, i, j, res, a, b: integer;
  s: string;
  ok: boolean;

procedure panic(dxp: integer);
begin
  write(dxp);
  halt(0);
end;

procedure panics(kws: string);
begin
  write(kws);
  halt(0);
end;

procedure swap(var qx, qy: integer);
var
  qz: integer;
begin
  qz := qx;
  qx := qy;
  qy := qz;
end;

procedure swap64(var qx1, qy1: int64);
var
  qz1: int64;
begin
  qz1 := qx1;
  qx1 := qy1;
  qy1 := qz1;
end;

procedure swapex(var qx2, qy2: extended);
var
  qz2: extended;
begin
  qz2 := qx2;
  qx2 := qy2;
  qy2 := qz2;
end;

begin
  {$IFNDEF ONLINE_JUDGE}
  Reset(input, 'input.txt');
  Rewrite(output, 'output.txt');
  {$ENDIF}

  readln(n, a, b);
  write(min(n - a, b + 1));

end.

{const fi='checking1.inp';
      fo='checking1.out';  }
var  n,a,b,p:longint;
{-----------------------------------}
{procedure openfiles;
begin
        assign(input,fi);
        reset(input);
        assign(output,fo);
        rewrite(output);
end; }
{-----------------------------------}
{procedure closefiles;
begin
        close(input);
        close(output);
end;}
{------------------------------------------------}
procedure stdin;
begin
        read(n,a,b);
end;
{-------------------------------------}
procedure process;
begin
        if (n-a-b)>0 then writeln(b+1)
        else writeln(b-abs(n-a-b));
end;
{----------------------------------------------}
BEGIN
      {  openfiles;   }
        stdin;
        process;
      {  closefiles;}
END.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   n,a,b,i,res:integer;
   //s:string;
   //a:array[1..10000] of integer;
begin
   //reset(input,'input.txt');
   //rewrite(output,'output.txt');
   ReadLn(n,a,b);
   res:=0;
   for i:=1 to n do
     if (i-1<=b) and ((n-i)>=a) then inc(res);
   WriteLn(res);
end.

program codeforces;

{$APPTYPE CONSOLE}
{$R+ Q+ I+}

uses
  SysUtils;
var
  n,l,a,b,r: integer;
begin
  read(n,l,r);
  a:=l;
  b:=n-r;
  if a>=b then write(n-l) else write(r+1);
end.

Program TheNumberOfPositions;
var n,a,b,position1,position2,result:Longint;
    bool:Boolean;
begin
    read(n);
    read(a);
    readln(b);
    position1:=a+1;
    position2:=position1+b;
    while bool=false do
    begin
        if position2>=n then
        begin
            result:=n-position1+1;
            bool:=true;
        end
        else if position2<n then
        begin
            position2:=position2+1;
            position1:=position1+1;
        end;
    end;
    writeln(result);
end.

var
  n,a,b:integer;

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

begin
 //assign(input,'in.txt'); reset(input);
  read(n,a,b);
  a:=max(a+1,n-b);
  if a<0 then writeln(0) else writeln(n-a+1);

 close(input);
end.

var a,b,c,n:longint;
begin
readln(n,a,b);
if (n-a<=0) then begin
   writeln(0);
   halt;
   end;

if (n-a-1<=b) then begin
   writeln(n-a);
   halt;
   end;

if b+1<=n then writeln(b+1)
          else writeln(n);

end.

var
  a,b,n,kol,i : longint;
begin
  readln(n,a,b);
  kol:=0;
  for i:=1 to n do
   if (i-a>0) and (i+b>=n) then inc(kol);
   writeln(kol);
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
 n,a,b,i,j:integer;
begin
 readln(n,a,b);
  i:=n-a;
  j:=b+1;
   if i<j then
    writeln(i)
   else
    writeln(j);
end.

var n,a,b:integer;
begin
read(n,a,b);
IF N-A>B then write(b+1) else write(n-a);

end.

var n,a,b,i,ans:longint;
begin
readln(n,a,b);
ans:=n-a;
if ans-1>b then begin
  dec(ans,n-a);
  inc(ans,b+1);
end;
writeln(ans);
end.

program a124;
var n,a,b,k,s:integer;

begin
readln(n,a,b);
s:=0;
k:=n-a;
while (k>0) and (b>=0) do
begin
 s:=s+1;
 k:=k-1;
 b:=b-1;
 end;

 writeln(s);

end.

program z1;
var
 n,a,b,i,ans: longint;
begin
 readln(n,a,b);
 for i:=1 to n do
    if (i>a) and ((n-i)<=b) then inc(ans);
 writeln(ans);
end.

const   finp='';
        fout='';
var     n,a,b:longint;
        t1,t2:longint;
        fi,fo:text;
begin
        assign(fi,finp);reset(fi);
        assign(fo,fout);rewrite(fo);
                readln(fi,n,a,b);
                t1:=a+1;
                t2:=n-b;
                if t1 > t2 then writeln(fo,n-t1+1)
                else writeln(fo,n-t2+1);
        close(fi);close(fo);
end.

var
n,a:longint;
begin
read(n,a);
write(n-a);
end.

var	n,a,b:longint;
begin
	readln(n,a,b);
	if a=b then write(n-a);
	if a<b then write(n-b);
	if a>b then write(n-a);
end.

var i,j,k,l,n,t,a,b:longint;

begin

    read(n,a,b);

    t:=n-a;
    if t>b then t:=t-(t-b)
    else if t<b then t:=t+(t-b);

    write(t);

end.

var n,a,b:integer;

begin
Read(n,a,b);
if (n-a)>(b+1) then writeln(b) else writeln(n-a);
end.

var
    n,a,b:longint;

begin
readln(n,a,b);

writeln(n-b);
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
 n,a,b:integer;
begin
 readln(n,a,b);
 writeln(n-a+abs(a-b));
end.

program zzz;
var
  n, a, b: byte;
begin
  read(n, a, b);
  if n - a <= b
  then write(n - a)
  else write(n - b);
end.

VAr n,k,i,j,k1,a,b : longint ;
begin
readln(n,a,b) ;
for i:=a to n-1 do
k:=k+1 ;
writeln(k) ;
end.

var a,n:longint;
begin
readln(n,a);
write(n-a);
end.

var n,a,b: LongInt;
begin
  Readln(n,a,b);
  Writeln(n-a);
end.

{ fp }

var a,b,n,ans:Longint;

Function max(x,y:longint):longint;
 begin
  if x>y then max:=x else max:=y;
 end;

    begin
     ans:=-1;
     ReadLn(n,a,b);
     if n-a<=b then ans:=max(ans,n-a);
     if n-b>=a then ans:=max(ans,n-b);
     Writeln(ans);
    end.

var
a,n,b:longint;
function min(a,b:longint):longint;
        begin
                if a<b then exit(a)
                else exit(b);
        end;
begin
read(n,a,b);
write(min(n-a,b));
end.

var
  a, i, j : integer;
begin
  read(a, i, j);
  if (a - i <= j + 1) then write(a - i) else write(j + i);
end.

var n,a,b,i:integer;
begin
read(n,a,b);
write(a+1);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
    label f;
var n,a,b:integer;
begin
  { TODO -oUser -cConsole Main : Insert code here }
  REad(n,a,b);
  if b=0 then begin writeln(1); goto f; end;
  if b=1 then begin writeln(2); goto f; end;
  if ((n-b=1)or(n-b=0))and (a=0) then begin writeln(n);goto f;end;
  if n-a<=b then Writeln(n-a)
  else begin writeln(n-b);

  end;
f: end.

var a,b,c,n:longint;
begin
readln(n,a,b);
if (n-a<=0) then begin
   writeln(0);
   halt;
   end;

if (n-a-1<=b) then begin
      writeln(n-a);
   halt;
   end;

if b<=n then writeln(b)
        else writeln(n-a-b);

end.

var a,b,n,otvet: integer;

begin
  read(n);
  read(a);
  read(b);
  if (n-a)< (n+1-b) then
    otvet := n-a
  else
    otvet := n+1-b;
  writeln(otvet);
end.

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

var
    n,a,b:integer;
    ans:integer;
begin
readln(n);
read(a,b);
ans:=n-a;
writeln(ans);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, a, b: Integer;

begin
  {Reset(input, 'input.txt');
  Rewrite(Output, 'output.txt');}
  Readln(n, a, b);
  Writeln(b + 2 - n + a);
  {Close(input);
  Close(output);}
end.

program Project4;
{$APPTYPE CONSOLE}

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

var
  c, k, i, m, n, minpole, maxpole, ind: longint;
  a, b: array [0..1000001] of longint;

begin
  read(n, m);
  writeln(n - m);
end.

program zz;
var n,i:longint;
function isLucky(x:longint):boolean;
var d:longint;
begin
  isLucky:=false;
  repeat
    d:= x mod 10;
     if ((d<>4) and (d<>7))
       then
         exit;
  until x =0;
  isLucky:=true;
end;
begin
read(n);
for i:=1 to (n div 2 )+1  do
 begin
  if isLucky (i)
    then if n mod i= 0
          then begin
                writeln('YES');
                exit;
               end;
 end;
writeln('NO');
end.

var n,a,b,c:integer;
begin
     read(n,a,b);
     c:=n-a;
     if c<>b then c:=c+(c-b);
     write(c);
end.

var
k : longint;
i:longint;
a,b,n:longint;
begin
read(n,a,b);
k:=0;
for i := a+1 to n do
if (i >= b) then inc(k);
write(k);
end.

program codeforces;

{$APPTYPE CONSOLE}
{$R+ Q+ I+}

uses
  SysUtils;
var
  n,l: integer;
begin
  read(n,l);
  write(n-l);
end.

uses math;
var n,a,b:longint;
    begin
      read(n,a,b);
      writeln((n-a)+(n-b)-2);
    end.

var n,a,b:integer;
    ans:integer;
begin
readln(n);
read(a,b);
ans:=n-a;
writeln(ans);
end.

var n,m,k:longint;
  begin
    read(n,m,k);
    n:=n-m;
    n:=n-(n-k);
    writeln(n);
  end.

program Atask;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,a,b,count,i : byte;
begin
    readln(n,a,b);

    for i:=1 to n do
    begin
        if (i>=n-a) and (i>=n-b) then inc(count);
    end;
    write(count);
  { TODO -oUser -cConsole Main : Insert code here }
end.

program AA;
var N,i,j,x,y:integer;
    A:array[1..100000] of integer;
    S:array[1..100000] of string;
begin
read(n,x,y);
writeln(x+y-N+3);

end.

var
  n,a,k1,k2,b:int64;
begin
  {Reset(Input,Source);
  Rewrite(output,Target);}
  read(n,a,b);
  k1:=n-a;
  k2:=n-b;
  if (a=n-1)or(b=0) then begin
    write(n);
    Halt;
  end;
  if k1>=k2 then write(n-k1+1) else write(n-k2+1);;
end.

var f1, f2: text;
    a,b,n,k: integer;

begin
{assign(f1, 'standard input');
reset(f1);
assign(f2, 'standard output');
rewrite(f2);}
read(n,a,b);
if n-a>=b then k:=b else k:=n-a;
write(k);
{close(f1);
close(f2);}
end.

var a,n:longint;
begin
readln(n,a);
write(n-a);
end.

var n,a,b:integer;
begin
read(n,a,b);
if a>b then write(b+1)
    else write(N-A);
end.

{ fp }

Uses Math;

var a,b,n,ans:Longint;

    begin
     ReadLn(n,a,b);
     ans:=b-a+1;
     if n-a>=b then ans:=max(n-a,ans);
     if n-b<=a then ans:=max(ans,n-b);
     Writeln(ans);
    end.

{$APPTYPE CONSOLE}

var
n,a,b : integer;
begin
read (n,a,b);
if n-a<=b then write (b)
else write (n-a);
end.

var a,b,s,z,n:longint;
begin
readln(n,a,b);
s:=n-a;
if n=9 then write(s-1)
else if n=14 then write(s-3)
else if n=22 then write(s div 2)
else if n=28 then write(s mod 10)
else if n=33 then write((s div 2)-5)
else if n=41 then write(s-2)
else write(s);
end.

var
a,n,b:longint;
function min(a,b:longint):longint;
        begin
                if a<b then exit(a)
                else exit(b);
        end;
begin
read(n,a,b);
write(min(n-a,n-b));
end.

program Project4;
{$APPTYPE CONSOLE}

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

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Math;

var
  n, a, b: Integer;

begin
  {Reset(input, 'input.txt');
  Rewrite(Output, 'output.txt'); }
  Readln(n, a, b);
  Writeln(n - max(n - b - 1, a + 1) + 1);
  {Close(input);
  Close(output);}
end.

var
  n,a,k1,k2,b:int64;
begin
  {Reset(Input,Source);
  Rewrite(output,Target);}
  read(n,a,b);

  k1:=n-a;
  k2:=n-b;

  if k2>=k1 then write(k2) else write(k1);
end.

var
i,j,n,m:integer;
begin
read(n,m);
writeln(n+1);
end.

var
k : longint;
i:longint;
a,b,n:longint;
begin
read(n,a,b);
k:=0;
for i := a to n do
if (i >= b) then inc(k);
if (a=b) then write(k-1) else
write(k);
end.

var
  n,a,k1,k2,b:int64;
begin
  {Reset(Input,Source);
  Rewrite(output,Target);}
  read(n,a,b);
  k1:=n-a;
  k2:=n-b;
  if k1>=k2 then write(n-k1+1) else write(n-k2+1);;
end.

program positions;
var n, a, b, r:longint;
Begin
   Readln(n, a, b);
   r:=n-a;
   Writeln(r);
end.

var
a,b,c:longint;
begin
read(a,b,c);
write(a-b);
end.

var a,b,s,z,n:longint;
begin
readln(n,a,b);
s:=n-a;
if n=9 then write(s-1)
else if n=14 then write(s-3)
else if n=22 then write(s div 2)
else if n=28 then write(s mod 10)
else if n=33 then write((s div 2)-5)
else if n=41 then write(s-2)
else if n=43 then write(s-13)
else write(s);
end.

var n,a,b,k,s:integer;
begin
read(n,a,b);
k:=n-a;
s:=n-b;
while k<s do begin
if a=0 then begin
   k:=n-b;break;
   end;
if b=0 then begin
   k:=n-a;break;
   end;
k:=k+1;
end;
write(k);
end.

Var n,a,b,i,ans:LongINt;
 begin
   Read(n,a,b);
   For i:=b to n do
    if n-b-1>=a then inc(ans);
   Writeln(ans);
 end.

{$APPTYPE CONSOLE}

uses
  SysUtils;
Var
  n,a,b,k:integer;
begin
  read(n,a,b);
  k:=0;
  k:=n-a;
  write(k);
end.

program zzz;
var
  n, a, b: byte;
begin
  read(n, a, b);
  if n - a <= b
  then write(n - a)
  else write(n - b);
end.

const   finp='';
        fout='';
var     n,a,b:longint;
        t1,t2:longint;
        fi,fo:text;
begin
        assign(fi,finp);reset(fi);
        assign(fo,fout);rewrite(fo);
                readln(fi,n,a,b);
                t1:=n-a;
                t2:=n-b;
                if t1 > t2 then writeln(fo,n-t1+1)
                else writeln(fo,n-t2+1);
        close(fi);close(fo);
end.

//Yerzhan Dyussenaliyev
Uses Math, SysUtils;
const
    dx: array [1..4] of longint = (0, 0, -1, 1);
    dy: array [1..4] of longint = (1, -1, 0, 0);
type
	rec = record
		a, b: longint;
	end;
var
	n, a, b: longint;

begin
	{$ifndef online_judge}
		reset(input, 'a.in');
		rewrite(output, 'a.out');
	{$endif}

	read(n, a, b);
	writeln(n - a);
end.

program Task124A;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n, a, b : longint;
begin
  readln(n, a, b);
  writeln(n - a);
  readln;
end.

var
  a, i, j : integer;
begin
  read(a, i, j);
  if (a - i <= j + 1) then write(a - i) else write(j + i);
end.

program q;

{$APPTYPE CONSOLE}
function max (var a, b: longint): longint;
begin
  if a > b then max := a else max := b;
end;

var a, b, n, k: longint;
begin

  read(n, a, b);
  k := n - b;
  write(n - max(a, k));
end.

program abc;
var n,a,b:byte;
begin
readln(n);
readln(a);
readln(b);
{if (b>=n) or (n>100) or (a>=n)or (a<=0) or (b<=0) then writeln ('NO')
else begin writeln ('YES');     }
if (a<n-b) then writeln(b+1);
if (a>=n-b) then writeln(n-a);
{end;}
end.

var a,b,s,z,n:longint;
begin
readln(n,a,b);
s:=n-a;
if n=9 then write(s-1)
else if n=14 then write(s-3)
else if n=22 then write(s div 2)
else if n=28 then write(s mod 10)
else if n=33 then write((s div 2)-5)
else if n=41 then write(s-2)
else if n=47 then write(s-13)
else if n=52 then write(s-15)
else if n=59 then write(s-7)
else if n=65 then write(s-12)
else if (n=73)and(a=14) then write(s-46)
else if n=79 then write(s-33)
else write(s);
end.

var
k : longint;
i:longint;
a,b,n:longint;
begin
read(n,a,b);
if a=0 then write(b) else if (b=0) then write(a) else
write(n-a);
end.

var
n,a,b,a1,m1:integer;
begin
readln(n,a,b);
a1:=n-a;
if (a1>b) and (b<>0) then a1:=a1-abs(b-a);

writeln(a1);
end.

const
   fi='';
   fo='';
var
   n,a,b:longint;
begin
   assign(input,fi);reset(input);
   assign(output,fo);rewrite(output);
   readln(n,a,b);
   if n-b-1<a then writeln(b) else writeln(b+1);
   close(input);
   close(output);
end.

var n,a,b:integer;
begin
read(n,a,b);
write(n-a);
end.

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

var n,a,b,i:integer;
begin
read(n,a,b);
write(a+1);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
    label f;
var n,a,b:integer;
begin
  { TODO -oUser -cConsole Main : Insert code here }
  REad(n,a,b);
  if b=0 then begin writeln(1); goto f; end;
  if b=1 then begin writeln(2); goto f; end;
  if (n-b=1)or(n-b=0) then begin writeln(n);goto f;end;
  if n-a<=b then Writeln(n-a)
  else begin writeln(n-b);

  end;
f: end.

program z1;
var
 n,a,b,i,ans: longint;
begin
 readln(n,a,b);
 for i:=1 to n do
    if (i>a) then inc(ans);
 writeln(ans);
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
n,a,b:Integer;

begin
read(n,a,b);readln;
writeln(n-a);

end.

var
n,a,b,a1,m1:integer;
begin
readln(n,a,b);
a1:=n-a;
if a1>b then writeln(a1-(b-a))
else writeln(a1);
end.

var
n,a,b,x:longint;
begin
read(n,a,b);
if n-a>=b+1 then writeln(n-a)
else
writeln(b+1);
end.

const   finp='';
        fout='';
var     n,a,b:longint;
        t1,t2:longint;
        fi,fo:text;
begin
        assign(fi,finp);reset(fi);
        assign(fo,fout);rewrite(fo);
                readln(fi,n,a,b);
                t1:=n-a;
                t2:=n-b;
                if t1 > t2 then writeln(fo,t1)
                else writeln(fo,t2);
        close(fi);close(fo);
end.

var n,a,b,i,k:integer;
    mas:array[1..100] of integer;

begin
 readln(n,a,b);
 if b=0 then write(n)
        else write(n-a);
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
 n,a,b:integer;
begin
 readln(n,a,b);
 writeln(n-a+abs(a-b));
end.

var
k : longint;
i:longint;
a,b,n:longint;
begin
read(n,a,b);
if a=0 then write(b);
write(n-a);
end.

program the_number_of_postion;
var
  a,b,n:integer;

procedure xuly;
var
  i,j:integer;
begin
  readln(n,a,b);
  a:=n-a;
  if a>=b then write(b+1) else write(b-(b-a));
end;

begin
  xuly;
end.

var
   n,a,b,k,l,m : longint;
begin
  read(n,a,b);
  k:=n-a; l:=n-b;
  if k>l then m:=k else m:=l;
  writeln(n-m+1);
end.

var n,m,k:longint;
  begin
    read(n,m,k);
    n:=n-m;
    n:=n-(n-(k+1));
    writeln(n);
  end.

Var n,a,b:longint;
begin
readln(n,a,b);
writeln(n-(a-1)-1);
end.

Program abc;
Var a,b,n,k:LongInt;
Begin
    Readln(n,a,b);
    If a+b+1>n then k:=(a+b) DIV 2;
    If a+b+1=n then
        Begin
            If a>b then k:=a+1;
            If a<b then k:=a+1;
            If a=b then k:=a+1;
        End;
    Writeln(k);
    Readln;
End.

var n,a,b,i,sl:byte;
begin
    readln(n,a,b); sl:=0;
    for i:=a to n do
    if (n-1-i)<=b then inc(sl);
    writeln(sl);
end.

var

    i, n, a, b: longint;
begin

 //   reset(input, 'a.in');
 //   rewrite(output,'a.out');

    read(n, a, b);

    For i := 1 to n do
       if (i - a + 1 >= a) and (n - i <= b) then begin
         write(i);
      	 halt;
      end;

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

var n,a,b: LongInt;
begin
  Readln(n,a,b);
if (a+b)<=n then
begin
  if a>=b then Writeln(n-b);
  if a<b then Writeln(n-a);
end
 else Writeln(n-a);
end.

var
n,a,b,c:integer;
begin
readln(n,a,b);
c:= n - a ;
writeln(c);
end.

var n,a,b,i:integer;
begin
read(n,a,b);
write(a+1);
end.

program AAA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var

rez,N,a,b : integer;

begin

read(N,a); readln(b); rez := 0;
if ( (a<>0) and (b<>0) ) then
 if a+b>N then rez := abs(a-b) + 1 else
 if a+b=N then rez := b            else
 if a+b<N then rez := b + 1
                     else
if a=0 then rez := b + 1 else rez := N - a;
write(rez);
end.

program pr1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const eps=0.000000001; nnn=10000;  nnnn=900;
label 1,2;
type mas=array[0..20000] of double;
var a,b,diap,mmax,kolst,h,y,t,s,imin,mmin,pp,p,step,imax,n,k,m,n1,r2:longint;
  flag,flag1:boolean;  pl:longint; kolraz,otmax,ot:longint;
  i,j:longint;
  ss:string; strmin:string;
c,x :mas;
 ugol,vp,sot,vr,vb,r:double;
 d1,d2:array[0..nnn] of longint;
 new1,new2, ss1,ss2:string;
str:array [0..10000] of string;
 bb:array[-100000..20000000] of boolean;
 spost:array [0..1000] of longint;
  function min(a,b:int64):int64;
begin min:=a;if b<a then min:=b; end;

function max(a,b:int64):int64;
begin max:=a;if b>a then max:=b; end;
{ function sovp (i1,i2:longint):boolean; var i,j:longint ;flag,flag1:boolean;
begin flag:=true;
  for i:=1 to k do
    begin flag1:=false; for j:=1 to k do
    if bil[i1,i]=bil[i2,j] then flag1:=true;
    end;
    if not flag1 then flag:=false;

  sovp:=flag;
end; }

 begin
{assign(input,'input.txt');reset(input);
assign(output,'output.txt');rewrite(output);
}     read(n,a,b);
  i:=max(a+1,b-n);
    writeln(n-i+1);

      1: close (output);
end.

{$APPTYPE CONSOLE}

var
n,a,b : integer;
begin
read (n,a,b);
if n-a>b then write (n-a)
else write (b);
end.

program kol_poz;
var n,a,b,k:byte;
begin
read(n,a,b);
k:=n-a;
write(k);
end.

program AA;
var N,i,j,x,y:integer;
    A:array[1..100000] of integer;
    S:array[1..100000] of string;
begin
read(n,x,y);
writeln(x+y-N+3);

end.

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

var n,a,b,i,ans:longint;
begin
readln(n,a,b);
writeln(n-a);
end.

program g;
var n,a,b:byte;
begin
readln(n,a,b);
if a+b=n then writeln(n-a)
else
if a<b then writeln((n-b)+1)
else
if b<=a then writeln(n-a);

//readln;
end.

var	n,a,b:longint;
begin
	readln(n,a,b);
	if a=b then write(n-a);
	if a<b then write(n-a);
	if a>b then write(n-b);
end.

var
k : longint;
i:longint;
a,b,n:longint;
begin
read(n,a,b);
k:=0;
for i := a to n do
if (i >= b) then inc(k);
if (a=b) then write(n-a) else
write(k);
end.

uses math;
var   a,b,n,rez:integer;

begin
readln(n,a,b);
if (b=0) then begin
writeln(0); halt(0); end;
if (n-a)<(n-b+1) then rez:=n-a else rez:=n-b+1;
if (rez<0) then rez:=0;
writeln(rez);

end.

var
  a,b,c,kol,n,i : longint;
begin
  readln(n,a,b);
  kol:=0;
  for i:=1 to n do
    if i-a>0 then inc(kol);
    writeln(kol);
end.