Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing behind him. Find the number of different positions Petr can occupy.

The only line contains three integers n, a and b (0 ≤ a, b < n ≤ 100).

Print the single number — the number of the sought positions.

NoteThe possible positions in the first sample are: 2 and 3 (if we number the positions starting with 1).In the second sample they are 3, 4 and 5.

#include <stdio.h>
int main(){
    int n, a, b;
    int c=0;
scanf("%d%d%d",&n,&a,&b);
    for(int i=1;i<=n;i++)
    {
        if(a<=i-1&&n-i<=b)
        {
        c++;
        }
    }
    printf("%d",c);
    return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b,p;
	scanf("%d%d%d",&n,&a,&b);
	//condition 5 3 2
	if(a+b==n && a>b)p=a;
	//condition 5 2 3
	else if(a+b==n && a<b)p=b;
	//condition 5 2 2
	else if(a==b && a+b<n)p=a+1;
	//condition 5 4 4
	else if(a==b && n==a+1)p=1;
	//condition 5 4 2
	else if(a+b>n)p=n-a;
	//condition 5 4 0
	else if(a!=b && a+b<n)p=b+1;

	printf("%d",p);
	return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b;
	scanf("%d %d %d",&n,&a,&b);
	if(a<n)
	{
		if(a+b>=n-1)
		printf("%d\n",n-a);
		else printf("%d\n",b+1);
	}
	else
		printf("%d\n",0);
	return 0;
}

#include<stdio.h>

int main()
{
    int n,a,b,count=0,i;
    scanf("%d%d%d",&n,&a,&b);
    for(i=a+1; i<=n; i++)
    {
        if(n-i<=b){count++;}
    }
    printf("%d\n",count);
    return 0;
}

#include<stdio.h>
int main()
{
int a,b,c,d;
scanf("%d%d%d",&a,&b,&c);
d=a-b;
if(d>c)
d=c+1;
printf("%d",d);

}

int main()
{
    int n,a,b;

    scanf("%d",&n);
    scanf("%d",&a);
    scanf("%d",&b);

    int count,l,m;

    l=n-a;
    m=b+1;

    if(l<m)
    {
        count=l;
    }
    else
    {
        count=m;
    }

    printf("%d",count);
    return 0;
}

#include <stdio.h>

int main()
{
   int n,a,b,c,d;
   scanf("%d %d %d",&n,&a,&b);
   c=n-a;
   d=n-(a+b+1);
   if(a+b+1<n)
   {
       printf("%d",c-d);
   }
   else
   {
       printf("%d",c);
   }
   return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>

int cmpfunc (const void * a, const void * b)
{
   return ( *(int*)a - *(int*)b );
}

main()
{
    //freopen("in.txt", "r", stdin);
    int i, n, j, c1 = 1, c50 = 0, a, b;

    scanf("%d %d %d", &n, &a, &b);

    i = n - b;
    if(a<i)
        printf("%d", b+1);
    else
        {
            j = n - a;
            j = b - j;
            printf("%d", b - j);
        }

}

#include <stdio.h>
int main()
{
	int n, a, b, pos;
	scanf("%d %d %d", &n, &a, &b);
	if((n-a)<(b+1))
	{
	    pos = (n-a);
	}
	else if((n-a)>(b+1))
	{
	    pos= (b+1);
	}

	else if ((n-a)==(b+1))
	{
	    pos = n-a;
	}
	printf("%d", pos);
	return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    if((n-a)<=(b+1))
        printf("%d\n",n-a);
    else
        printf("%d\n",b+1);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a ;
    int b ;
    int n ;
    scanf("%d",&n);
    scanf("%d",&a);
    scanf("%d",&b);
    if (n-a<=b){
        printf("%d",n-a);
    }
    else {
        printf("%d",b+1) ;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d %d %d\n",&n,&a,&b);
    int c=0;
    for(int i=1;i<=n;i++)
    {
        if(i-1>=a && n-i<=b)
        c=c+1;
    }
   printf("%d\n",c);
   return 0;
}

#include <stdio.h>

int main()
{
    int n, a, b, rest, count = 1;
    scanf("%d %d %d", &n, &a, &b);

  //  rest = n - (a + 1);
    if(n-(a+1) >= b)
        count = count + b;
    else
        count = count + n - (a + 1);

    printf("%d", count);

    return 0;
}

#include<stdio.h>
int main()
{
    int a,b,n;
    scanf("%d%d%d",&n,&a,&b);
    if((n-a)<b+1){
    printf("%d",(n-a));
    }
    else printf("%d",(b+1));
}

#include<stdio.h>
int main()
{
    int n,a,b,c,r;
    scanf("%d%d%d",&n,&a,&b);
    c=n-a-1;
    if(c>b){
        r=b+1;
    }else{
        r=c+1;
    }
    printf("%d",r);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,x;
    scanf("%d%d%d",&n,&a,&b);

    x=n-a;
    if(x<=b)
        printf("%d",x);
    else if(x-b==1)
        printf("%d",x);
    else
        printf("%d",b+1);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,s,m,d;
    scanf("%d%d%d",&n,&a,&b);
    m=a+1;
    d=n-b;
    if(m>d){
    s= n-m+1;
    printf("%d\n",s);
    }
    else if(d>m){
    s= n-d+1;
    printf("%d\n",s);
    }
    else if(m==d){
    s= n-m+1;
    printf("%d\n",s);
    }
    return 0;
}

#include<stdio.h>
main()
{
    int a,b,n,e,i,c,d,cnt=0,max=0,s=0;
    scanf("%d %d %d",&a,&b,&c);

    d=a-b;
    e=c+1;
    if(d<=e)
        printf("%d",d);
    else
        printf("%d",e);

}

#include<stdio.h>
int main()
{
int n,a,b;
scanf("%d%d%d",&n,&a,&b);
    if(n-a<=b){
        printf("%d",n-a);
    }
    if(n-a>b){
            printf("%d",b+1);

    }

return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,i,c=0;
    scanf("%d%d%d",&n,&a,&b);
    for(i=1;i<=n;i++)
    {
        if(i>a&&(n-i)<=b)
       // printf("%dg\n",i);
            c=c+1;
    }
    printf("%d",c);
    return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b,i,k=0;
	scanf("%d %d %d",&n,&a,&b);
	for(i=a+1;i<=n;i++)
	{
		if(n-i<=b)
		k+=1;
		}
		printf("%d",k);
}

#include<stdio.h>

int main()
{
    int n,a,b,count=0,i;
    scanf("%d%d%d",&n,&a,&b);
    for(i=a+1; i<=n; i++)
    {
        if(n-i<=b){count++;}
    }
    printf("%d\n",count);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,b,a;
    scanf("%i %i %i",&n,&a,&b);
    if(n-a==b)
        printf("%i",b);
    else if((n-a)<b)
        printf("%i",(n-a));
    else
        printf("%i",b+1);
    return 0;
}

#include<stdio.h>

int main()
{

	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);

	int x, y, count=0;

	for(x=a; x<n; x++)
	{
		for(y=0; y<=b; y++)
		{
			if( x+y == (n-1))
				count++;
		}
	}

	printf("%d\n",count);

return 0;
}

#include <stdio.h>

int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    if(n-a>=b+1){
        printf("%d",b+1);}
    if(n-a<b+1){
        printf("%d",n-a);}
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int arr[3];
    int i;
    for(i=0;i<3;i++){
        scanf("%d",&arr[i]);
    }
    int ans=arr[0]-arr[1]-1;
    int d=ans-arr[2];
    while(d>0){
        ans-=1;
        d=ans-arr[2];
    }
    printf("%d",ans+1);
    return 0;
}

#include <stdio.h>

#define MAX(a, b) ((a > b) ? a : b)

int main(){
  int n, a, b;
  scanf("%d %d %d", &n, &a, &b);
  printf("%d\n", n - MAX(a + 1, n - b) + 1);
  return 0;
}

#include <stdio.h>

int main()
{
   int n,a,b,c,d;
   scanf("%d %d %d",&n,&a,&b);
   c=n-a;
   d=n-(a+b+1);
   if(a+b+1<n)
   {
       printf("%d",c-d);
   }
   else
   {
       printf("%d",c);
   }
   return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    int n,a,b,i,count=0;
    scanf("%d %d %d",&n,&a,&b);
    for(i=1;i<=(n-a);i++){
            if(i<=(b+1)){
                count++;
            }
            else
                continue;
            }
 printf("%d\n",count);
return 0;
}

#include<stdio.h>

int main()

{

int n, a, b;

scanf("%d %d %d", &n, &a, &b);

if(n-a < 1+b)
printf("%d",n-a);

else
printf("%d", b+1);

return 0;
}

#include<stdio.h>
//using namespace std;
int main()
{
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	int u=b+1;
	if(u>=n-a)
		u=n-a;
	printf("%d\n",u);
	return 0;
}

#include <stdio.h>

int main()
{
    int a,b,n;
    scanf("%d %d %d",&n,&a,&b);
    if( a + b > n )
        printf("%d",n-a);
    else
        printf("%d",b+( a + b != n ));
    return 0;
}

#include<stdio.h>

int main()
{
    int n,a,b,count=0;
    scanf("%d %d %d",&n,&a,&b);
    while(1)
    {
        n--;
        if(n>=a && count<=b)
            count++;
        else
            break;
    }
    printf("%d\n",count);
    return 0;
}

#include<stdio.h>
int main()
{
long long int n,a,b,t=0,c=0;
scanf("%I64d%I64d%I64d",&n,&a,&b);
t=n;
while(t>=(n-b)&&t>a)
{
    t=t-1;
    c=c+1;
}
printf("%I64d",c);
return 0;}

#include<stdio.h>
int main()
{
    int n,a,b,c,d,ans;
    scanf("%d %d %d",&n,&a,&b);
    c=a+1;
    d=n-c;

    if(d<b)
    {
        ans=n-a;
    }
    else
    ans=b+1;
    printf("%d",ans);
    return 0;
}

#include <stdio.h>

int main(void){
	int a,b,n;
	scanf("%d%d%d",&n,&a,&b);
	if(a+b+1<=n)
		printf("%d",b+1);
	else
		printf("%d",n-a);
	return 0;
}

#include<stdio.h>
int main()
{
	int n;
	while (~scanf("%d", &n))
	{
		int a, b, cnt = 0;
		scanf("%d %d", &a, &b);

		for (int i = a + 1; i <= n; i++)
			if (n - i <= b)
				cnt++;

		printf("%d\n", cnt);
	}

	return 0;
}

#include<stdio.h>

int main()
{
    int a,b,n;
    scanf("%d %d %d",&n,&a,&b);
    if(n-a<=b+1)
       printf("%d", n-a);
    else
       printf("%d",b+1);
}

#include <stdio.h>
int main()
{
  int a,b,n,s=0,i;
  scanf("%d%d%d",&n,&a,&b);
  for(i=0; i<n; i++)
    if(i>=a&&(n-i-1)<=b) s++;
   printf("%d",s);
   return 0;
}

#include<stdio.h>
main()
{
    int a,b,c,d,e;
    scanf("%d %d %d",&a,&b,&c);
    d=a-b;
    e=b-c;
    if(c+1<d)
    {
        printf("%d",c+1);
    }
    else
    {
        printf("%d",d);
    }
    return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b;scanf("%d%d%d",&n,&a,&b);int c=0;
	for(int i=a+1;i<=n;i++){
		if(n-i<=b) c++;
	}
	printf("%d",c);
}

#include <stdio.h>

int main(){

    int num, left, right, result, i, right_side = 0;

    scanf("%d %d %d", &num, &left, &right);

    for(i = left + 1; i <= num && right_side < right; i++){
        right_side++;
    }

    while(left + 1 + right_side < num){
        left++;
    }

    result = num - left;
    printf("%d\n", result);

    return 0;

}

#include<stdio.h>
int main()
{
    int n,a,b,x,ans;
    scanf("%d %d %d",&n,&a,&b);
    x=n-a-1;
    if(x>b)
   { ans=b+1;}
    else{
    ans=x+1;}
    printf("%d\n",ans);
}

#include<stdio.h>
int main()
{
   int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  if(a-b<=c+1)
     printf("%d",a-b);
else
printf("%d",c+1);
  return 0;
}

//copied
#include <stdio.h>
int min(int a,int b)
{
  if(a<b)
     return a;
  return b;
}

int main(void)
{
    int n,a,b,p;
    scanf("%d %d %d",&n,&a,&b);
    p=min(n-a,b+1);
    printf("%d",p);
    return 0;
}

#include <stdio.h>

int main() {

	int n, a, b, start, ans = 0;
	int i;

	scanf("%d %d %d", &n, &a, &b);

	start = a+1;

	for (i = start; i <= n; i++)
	{
		if (n-i <= b)
		{
			ans += 1;
		}
	}

	printf("%d\n", ans);

	return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,c,d,e;
    scanf("%d %d %d",&n,&a,&b);
    c = n-a;
    if(c==b)
        {
            printf("%d",b);
        }
    else if(c>b)
        {
            printf("%d",b+1);
        }
    else if(c<b)
        {
            printf("%d",c);
        }
    return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    if(n-a<=b)
    {
        printf("%d",n-a);
    }
    else
    {
        printf("%d",b+1);
    }
    return 0;
}

#include<stdio.h>
int main () {
    int i,j,k,n,a,b,ss=0,dizi[105]={};
    scanf("%d %d %d",&n,&a,&b);
    for(i=a;i<n;i++)
        if(n-i-1<=b)
            ss++;
    printf("%d\n",ss);
return 0;
}

#include<stdio.h>
int main()
{
    int i,j,k,l;
    scanf("%d %d %d", &i, &j, &k);
    if(i-j<=k)printf("%d", i-j);
    else printf("%d", k+1);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
	int a,b;
	int n;
	int i;
	int cnt=0;
	int judge[100] = {0,};
	scanf("%d %d %d",&n,&a,&b);
	for(i=a;i<n;i++)
	{
		judge[i]++;
	}
	for(i=n-1;i>=n-b-1;i--)
	{
		judge[i]++;
	}
	for(i=0;i<n;i++)
	{
		if(judge[i]==2) cnt++;
	}
	printf("%d",cnt);
	return 0;
}

#include<stdio.h>
int main()
{
int n,a,b;
scanf("%d%d%d",&n,&a,&b);
if(a+b>=n)
{
printf("%d", n-a);
}
else
{
printf("%d", b+1);
}
return 0;
}

#include <stdio.h>

int main()
{
      int n,a,b;
      scanf("%d%d%d",&n,&a,&b);
      if(n-a-1>b){
             printf("%d",b+1);
      }else {
              printf("%d",n-a);
      }
       return 0;
}

#include<stdio.h>
int main(void)
{
    int a, b, n, i, j, count=0;
    scanf("%d%d%d", &n, &a, &b);
    for(i=a; i<=n; i++)
    {
        for(j=b; j<=n && j>=0; j--)
        {
            if(i+j+1 == n)
            {
                count++;
            }
        }
    }
    printf("%d", count);
    return 0;
}

#include <stdio.h>
int main()
{
	int n,a,b;
	scanf("%d %d %d",&n,&a,&b);
	if(a+b<n)
	{
		printf("%d\n",b+1);
	}
	else
	{
		printf("%d\n",n-a);
	}
	return 0;
}

#include <stdio.h>
int main()
{
    int n,a,b,res;
    scanf("%d %d %d",&n,&a,&b);
    res=n-a;
    if (res > b+1){
        res = b+1;
    }

    printf("%d",res);

    return 0;
}

#include<stdio.h>

int main()
{
    int n,a,b,count=0,i;
    scanf("%d%d%d",&n,&a,&b);
    for(i=a+1; i<=n; i++)
    {
        if(n-i<=b){count++;}
    }
    printf("%d\n",count);
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int n,a,b,f[100],ba[100],j,k,l,m,count=0,i,len1,len2;
    scanf("%d %d %d",&n,&a,&b);
    for(i=0,j=a;j<n;j++,i++){
        f[i]=j;
    }
    for(k=0,j=n-b-1;j<n;j++,k++){
        ba[k]=j;
    }
    for(l=0;l<i;l++){
        for(m=0;m<k;m++){
             if(f[l]==ba[m]) count++;
        }
    }
    printf("%d\n",count);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,d,r;
    scanf("%d %d %d",&n,&a,&b);
    n=n-a;
    if(n==1)
        r=1;
    else
    {
        if(n>b)
            r=b+1;
        else if(n==b)
        r=b;
        else
            r=n;
    }
    printf("%d\n",r);
    return 0;
}

#include<stdio.h>
int main()
{
int n,a,b;
scanf("%d%d%d",&n,&a,&b);
if(n-a<=b)
{
    printf("%d",n-a);
}
else
{
if(n-a>b)
{
printf("%d",b+1);
}
else
{
printf("%d",b);
}
}
return(0);
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,n,p,ans=0;
    scanf("%d %d %d",&n,&a,&b);
    if((a+b)==n)
    ans=b;
    else
    {
        if((a+b)>n)
        ans=n-a;
        else if((a+b)<n)
        ans=b+1;
        else if(b==0 || (a==0 && b==n-1))
        ans=1;
    }
   // ans=b+1;

    printf("%d\n",ans);
    return 0;
}

#include<stdio.h>
int main()
{
int n,a,b;
scanf("%d%d%d",&n,&a,&b);
 if (n-b>a)
  printf("%d",b+1);
else
printf("%d",n-a);
return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,x;
    scanf("%d%d%d",&n,&a,&b);

    x=n-a;
    if(x<=b)
        printf("%d",x);
    else if(x-b==1)
        printf("%d",x);
    else
        printf("%d",b+1);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define re(i,n) for(i = 0; i < n; i++)

int min(int a, int b) {
  if(a < b) return a;
  else return b;
}

int main()
{
  int a,b,n;

  scanf("%d%d%d", &n, &a, &b);

  printf("%d", min(n - a, b + 1));

  return 0;
}

 #include <stdio.h>
main()
{int a,b,n;
scanf("%d%d%d",&n,&a,&b);
while(a>n-b-1)
b--;
printf("%d",b+1);
return 0;}

#include<stdio.h>

int main()
{
    int n,a,b,p;
    scanf("%d %d %d",&n,&a,&b);
    if((a+b)<n)    p = b+1;
    else if((a+b)==n)    p = b;
    else    p = n-a;
    printf("%d\n",p);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
	int a,b;
	int n;
	int i;
	int cnt=0;
	int judge[100] = {0,};
	scanf("%d %d %d",&n,&a,&b);
	for(i=a;i<n;i++)
	{
		judge[i]++;
	}
	for(i=n-1;i>=n-b-1;i--)
	{
		judge[i]++;
	}
	for(i=0;i<n;i++)
	{
		if(judge[i]==2) cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}

#include<stdio.h>
int main()
{
    int a,b,n,i,x,count=0,y;
    scanf("%d%d%d",&n,&a,&b);
    for(i=a+1;i<=n;i++) {
            y=n-i;
        if(y<=b) {
            count++;
        }
    }
    printf("%d",count);
}

#include<stdio.h>
int main()
{
      int n,a,b;
      scanf("%d%d%d",&n,&a,&b);
      if(n-a<=b)
      printf("%d",n-a);
	else
		printf("%d",b+1);
}

#include<stdio.h>

int min(int a,int b){
    return a > b ? b:a;
}
int main(){
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    printf("%d",min(n-a,b+1));
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,m;
    scanf("%d %d %d",&n, &a, &b);
    int l;
    l=n-a;
    m=b+1;
    if(l>m)
        printf("%d", m);
    else
        printf("%d", l);
return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()

{
    int n,a,b,q,r;

    scanf("%d%d%d",&n,&a,&b);
    q=n-a;
    r=b+1;
    if(q>r)
        printf("%d",r);
    else
        printf("%d",q);

}

#include<stdio.h>
int main(){
int a,b,c,d,e,f;
scanf("%d%d%d",&a,&b,&c);
if(b+c<=a-1){
printf("%d",c+1);
}
else{
while(b+c!=a-1){
c=c-1;
}

printf("%d",c+1);
}
}

#include<stdio.h>
int max(int,int);
int max(int a,int b)
{
    if(a>b)
    return a;
    else
    return b;
}
int main()

{
    int n,a,b;
    scanf("%d %d %d", &n,&a,&b);
    printf("%d",n-max(a+1,n-b)+1);
    return 0;
}

#include<stdio.h>
int max(int, int);
int main()
{
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	printf("%d", n - max(a + 1, n - b) + 1);
	return 0;
}

int max(int a, int b)
{
	return a >= b ? a : b;
}

#include<stdio.h>
int main()
{
      int n,a,b;
      scanf("%d%d%d",&n,&a,&b);
      int x;
      x=n-a;
      if(x>b) printf("%d",b+1);
      else printf("%d",x);
}

#include<stdio.h>
int main(){
	int a,b,n;
	scanf("%d%d%d",&n,&a,&b);
	if (a+b<n) printf("%d",b+1);
	else if (a+b>n) printf("%d",n-a);
	else if (a+b==n) printf("%d",b);
}

#include <stdio.h>

int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    if(n-a>=b+1){
        printf("%d",b+1);}
    if(n-a<b+1){
        printf("%d",n-a);}
    return 0;
}

//http://codeforces.com/problemset/problem/124/A

#include <stdio.h>

int main(){
	int num, a, b, ans=0;
	scanf("%d %d %d", &num, &a, &b);
	num-=a;
	b = b+1;
	if(b<num) ans = b;
	else ans = num;

	printf("%d", ans);
	return 0;
}

#include<stdio.h>
int main()
{
   int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  if(a-b<=c+1)
     printf("%d",a-b);
else
printf("%d",c+1);
  return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,x,i,count=0;
    scanf("%d %d %d",&n,&a,&b);
    x=n-a;
    for(i=a+1;i<=n;i++)
    {
        if(n-i<=b)
        {
            count++;
        }
    }
    printf("%d\n",count);

    return 0;

}

#include<stdio.h>
int main(){
int n,a,b,x=1,s=0;

scanf("%d",&n);
scanf("%d",&a);
scanf("%d",&b);

if (n==1)
printf ("%d",n);
else
{
	while (x<=n)
	{if ((x>a)&&((n-x)<=b))
	s++;
	x++;
	}

	printf("%d",s);
}

}

#include<stdio.h>
int main()
{
    int n,a,b,x,y;
    scanf("%d%d%d",&n,&a,&b);
    x=n-a;
    y=b+1;
    if(x<y)
        printf("%d",x);
    else
        printf("%d",y);
}

#include<stdio.h>
#include<math.h>
int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    if(b!=0)
    {
    printf("%d",a+1);
    }
    if( a==n && b==0)
    {
        printf("%d",n);
    }
    return 0;
}

#include<stdio.h>
int main()
{
  int n,a,b,c,i;
  scanf("%d%d%d",&n,&a,&b);
  printf("%d\n",n-a);

  return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int arr[3];
    int i;
    for(i=0;i<3;i++){
        scanf("%d",&arr[i]);
    }
    int p1=arr[1]+1;
    int p2=arr[2]+1;
    int p;
    if(p1>=p2){
        p=p2;
    }
    else{
        p=p1;
    }
    if((arr[0]/2)<p){
        p=arr[0]-p+1;
    }
    printf("%d",p);
    return 0;
}

#include<stdio.h>

int main()
{
    int n,a,b,p;

    scanf("%d %d %d",&n,&a,&b);

    p=1+a;
    for(;;){
        if(n-p<=b)break;
        else p++;
    }

    printf("%d",p);

    return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b,p;
	scanf("%d%d%d",&n,&a,&b);
	//condition 5 3 2
	if(a+b==n)p=a;
	//condition 5 2 2
	else if(a==b && a+b<n)p=a+1;
	//condition 5 4 4
	else if(a==b && n==a+1)p=1;
	//condition 5 4 2
	else if(a+b>n)p=n-a;
	printf("%d",p);
	return 0;
}

#include<stdio.h>
int main()
{
long long a, b,c,d,e,f;
scanf("%lld %lld %lld",&a,&b,&c);
if(b==1&&c==1)
{
f=a-1;
}
else if(b==0)
{
f=a%c;
}
else if(c==0)
{
f=a%b;
}
else if(b==c)
{
f=a%b;
}
else if(a%b==0)
{
d=a/b;
e=a%c;
f=d+e;
}
else if(a%c==0)
{
e=a/c;
d=a%b;
f=d+e;
}
else if(a%b==0&&a%c==0)
{
d=a/b;
e=a/c;
f=d+e;
}
else
{
d=a%b;
e=a%c;
f=d+e;
}
printf("%lld",f);
return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d %d %d\n",&n,&a,&b);
    int sum=0;
    sum=a+b;
    int c;
    if(sum==n)
    {
        c=a+1;
        printf("%d\n",c);
    }
    else
    {
        c=a+1;
        printf("%d\n",c);
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int a,b,n;
    scanf("%d%d%d",&n,&a,&b);
    if (a+1<=b) printf("%d\n",a+1);
    else printf("%d\n",b+1);
    return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b,l,v;
	scanf("%d%d%d",&n,&a,&b);
	if (a>=b)
	{
	v=a-b;
	l=n-a-v;
   }
    else
	{
		l=n-a;
	}
	printf("%d",l);
	return 0;
}

#include<stdio.h>
int main(){
int n,p,q,a;
scanf("%d %d %d",&n,&p,&q);
if (p>=q)
printf("%d",n-q);
else printf("%d",n-p);
return 0;

}

#include<stdio.h>
int main ()
{
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    while(b>(a-c))
    c--;
    printf("%d",b);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,i,c=0;
    scanf("%d%d%d",&n,&a,&b);
    for(i=0;i<n;i++)
    {
        if(i>a&&(n-i)>=b)
       // printf("%dg\n",i);
            c=c+1;
    }
    printf("%d",c);
    return 0;
}

#include<stdio.h>
int main()
{

    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    int c=a+b;
    int d=n-c;

    printf("%d\n",d+b);

}

#include<stdio.h>
int main()
{
	int n,a,b;
	scanf("%d %d %d",&n,&a,&b);
	if(a<n)
	{
		printf("%d\n",n-a);
	}
	else
		printf("%d\n",0);
	return 0;
}

#include <stdio.h>

int main()
{
    int n,a,b,r,p=0;
    scanf("%d %d %d",&n,&a,&b);

    r=n-a;
    if(b<n-a){
    while(r<=n)
    {
        if(r>=n-b)
        {
            p++;
        }
        r++;
    }
    printf("%d",p);
    }
    else{printf("%d",r);}

    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,x;
    scanf("%d%d%d",&n,&a,&b);

    x=n-a;

    printf("%d\n",x);

    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,i,c=0;
    scanf("%d%d%d",&n,&a,&b);
    for(i=0;i<n;i++)
    {
        if(i>a&&n-i<=b)
       // printf("%dg\n",i);
            c=c+1;
    }
    printf("%d",c);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    if(a>=b)
    {
         printf("%d\n",n-a);
    }
    else
    {
         printf("%d\n",b+1);
    }
}

#include<stdio.h>
int main()
{
    int n,a,b,i,cnt=0;
    scanf("%d %d %d",&n,&a,&b);
    for(i=1;i<=n;i++)
    {
        if(i>=a && i<=b)
        cnt++;
    }
    printf("%d\n",cnt+1);
}

#include<stdio.h>
int main()
{
  int n,a,b,c,i;
  scanf("%d%d%d",&n,&a,&b);
  if(a-b==1)
    printf("%d\n",a);
  else
  printf("%d\n",n-a);

  return 0;
}

#include<stdio.h>
int main(){
int n,p,q,a;
scanf("%d %d %d",&n,&p,&q);
a=n-p;
if (a>q)
printf("%d",a+1);
else printf("%d",a);
return 0;

}

#include<stdio.h>
int main()
{
    int n,a,b,s,r,fact=1;
    scanf("%d %d %d", &n, &a, &b);
    if(0<=a&&b<n<=100)
    {
        s=(n-a);
        //for (r = 1; r <= s; r++)
             //fact=fact*r;
        printf("%d",s);
    }
    else
    {
        printf("wrong output");
    }
}

#include<Stdio.h>
int main()
{
    int n,a,b,x,y,z;
    scanf("%d",& n);
    scanf("%d",& a);
    scanf("%d",& b);
    if(a=b)
    {
        x=1;
    }
    else if(b>a)
    {
        x=b-a;
    }
    else if(a>b)
    {
        x=a-b;
    }
    y=(n+x)/2;
    printf("%d", y);

}

#include <stdio.h>
int main()
{
	int n, a, b, pos;
	scanf("%d %d %d", &n, &a, &b);
	if(b=0)
	{
	    pos = 1;
	}
	else if(a=0)
	{
	    pos=n;
	}
	else
	{
	    pos = 1+((a+b)/2);
	}
	printf("%d", pos);
	return 0;
}

#include <stdio.h>
int main()
{
    int a,b,c,n;
    scanf("%d %d %d",&a,&b,&c);
    if(b+c==a){
        n=a-b;
    }
    else{
        n=b+1;
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
int main()
{
int n,a,b;
scanf("%d%d%d",&n,&a,&b);
if(a+b>=n)
{
printf("%d", n-a);
}
else
{
if(a>b)
{
printf("%d",a+1);
}
else
{
printf("%d", n-b);
}
}
return 0;
}

#include<stdio.h>
int main()
{
	int n;
    int a,b;
    scanf("%d ",&n);
    scanf("%d ",&a);
    scanf("%d ",&b);
    int k=0;
  while(a<n-b)
  a++;
   for(int i=a+1;i<=n;i++)
   k++;
    printf("%d",k);
	return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    if(a+b==n){printf("%d",b);}
    if(a+b<n){printf("%d",n-a);}
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,i,c=0;
    scanf("%d%d%d",&n,&a,&b);
    for(i=0;i<n;i++)
    {
        if(i>a&&n-i<b)
       // printf("%dg\n",i);
            c=c+1;
    }
    printf("%d",c);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,i;
    scanf("%d %d %d", &n,&a,&b);
    i=a+1;
    printf("%d",i);
    return 0;

}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int ntotal, aless, bmore, front=0;
	int * number;
	int i, j=0;
	scanf("%d %d %d", &ntotal, &aless, &bmore);

	number=(int *)malloc(ntotal * sizeof(int));

	for(i=0;i<ntotal-1;i++) {
		number[i]=1;
		front+=number[i];
		if(front>=aless && (ntotal-front-1)<=bmore)
			j++;
	}

	printf("%d\n", j);
	free(number);

	return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    printf("%d\n",n-a);
    return 0;
}

#include<stdio.h>
int main(){
int a,b,c;scanf("%d %d %d",&a,&b,&c);
printf("%d",b+1);
}

#include <stdio.h>
int main()
{
	int n,a,b;
	scanf("%d %d %d",&n,&a,&b);
	printf("%d\n",n-b+a-1);
	return 0;
}

#include<stdio.h>
int main()
{
    int a,b,n;
    scanf("%d%d%d",&n,&a,&b);
    if(a+b<=n){
       if (a+1<=b) printf("%d\n",a+1);
    else printf("%d\n",b+1);
    }
    else if(a==b&&(a+b)>n)
    {
        printf("1\n");
    }

    return 0;
}

#include<stdio.h>
int main()
{
    int a,b,c,e;
    scanf("%d %d %d",&a,&b,&c);
    if((b+c)==a)
    {
        e= a-b;
    }
    else if((b+c)<a)
    {
        e= c+1;
    }
    printf("%d",e);
    return 0;
}

#include<stdio.h>

int main()
{
	int a,b,n,x;
	scanf("%d %d %d",&n,&a,&b);

	//not less then 'a' & not more than 'b'
	x = n - (int)(a+b)/2;
	printf("\n%d\n",x);
	return 0;
}

#include<stdio.h>
main()
{
    int n,a,b,i;
    scanf("%d%d%d",&n,&a,&b);
    for(i=1;i<=n;i++)
    {
        if(i>a && (i)<b)
        {
         printf("%d",i);
            break;
        }
    }
}

#include<stdio.h>
main()
{
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    int x,p;
    x=a+b;
    if(x>=n)
    {
        p=a+1;
    }
    else
    {
        p=n-b;
    }
    printf("%d",p);
    return 0;
}

#include<stdio.h>
int main()
{
    int a , b , n , ans , solve ;
    scanf("%d%d%d",&n,&a,&b);
    ans = n - a ;
    solve = n - b ;
    if(ans>=solve)
    {
        printf("%d",ans);
    }
    else
    {
        printf("%d",solve);
    }
    return 0;
}

#include<stdio.h>
int main()
{
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	printf("%d\n", n - a);
	return 0;
}

#include <stdio.h>
int main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if (a-b-1<=c)
    {
        printf("%d",a-b);
    }
    if (a-b-1>c)
    {
        printf("%d",c);
    }
}

#include<stdio.h>

int main()
{
    int n,a,b,p;
    scanf("%d %d %d",&n,&a,&b);
    if((a+b)==n)    p = b;
    else if((a+b)<n)    p = n-a;
    printf("%d\n",p);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a ;
    int b ;
    int n ;
    scanf("%d",&n);
    scanf("%d",&a);
    scanf("%d",&b);
    if (n-a<b){
        printf("%d",n-a);
    }
    else {
        printf("%d",b+1) ;
    }
    return 0;
}

#include<stdio.h>
int main ()
{
    int n, a, b;
    scanf("%d%d%d", &n, &a, &b);
    printf("%d\n",b+1);
    return 0;
    }

#include <stdio.h>

int main()
{
      int n,a,b;
      scanf("%d%d%d",&n,&a,&b);
      if(a+b<=n){
             printf("%d",b);
      }else {
              printf("%d",n-a+1);
      }
       return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    if(a+b==n){printf("%d",b);}
    if(a+b<n){printf("%d",n-a);}
    if(a+b>n){printf("%d",n-a);}
    return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b;
	scanf("%d %d %d",&n,&a,&b);
	if(a+b==n)
		printf("%d",n-a);
	else
		printf("%d",b+1);
return 0;
}

#include<stdio.h>
int main()
{
int n,a,b,c;
scanf("%d%d%d",&n,&a,&b);
if(n-a-1>=b)
{
printf("%d",b+1);
}
else
{
printf("%d",n-a-1);
}
return 0;
}

#include<stdio.h>
int main()
{
      int n,a,b;
      scanf("%d%d%d",&n,&a,&b);
      int x;
      x=n-a;
      if(b>=x) printf("%d",b);
      else printf("%d",b+1);
}

#include<stdio.h>

int main()
{
      int n,a,b;
      scanf("%d%d%d",&n,&a,&b);
      if(n-a>b+1)
      printf("%d",n-a);
      else
      printf("%d",b+1);
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    printf("%d",n-a);
}

#include<stdio.h>
int main()
{
    int a , b , n , ans , solve ;
    scanf("%d%d%d",&n,&a,&b);
    if(a<=b)
    {
        ans = n - a ;
        printf("%d", ans);
    }
    else
    {
        ans = n - a ;
        solve =n - ans ;
        printf("%d", solve);
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
int main(){
    int a,b,n,way;
    scanf("%d%d%d",&n,&a,&b);
    if(n<a+b&&a>b){way=n-a;}
    else if(n==a+b){way=b;}
    printf("%d",way);
    return 0;}

#include <stdio.h>

int main(void)
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    printf("%d",a+1);
    return 0;
}

#include<stdio.h>
int main(){
int a,b,c,d,e,f;
scanf("%d%d%d",&a,&b,&c);
if(b+c==a-1){
printf("%d",c+1);
}
else{
while(b+c!=a-1){
c=c-1;
}
printf("%d",c+1);
}
}

#include<stdio.h>
int main()
{
    int a,b,c,e;
    scanf("%d %d %d",&a,&b,&c);
    if((b+c)==a)
    {
        e= a-b;
    }
    else if((b+c)<a)
    {
        e= c+1;
    }
    printf("%d",e);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,L;
    scanf("%d%d%d",&n,&a,&b);
    printf("%d",n-a);
}

#include<stdio.h>
int main()
{
      int n,a,b;
      scanf("%d%d%d",&n,&a,&b);
      printf("%d",n-a);
}

#include <stdio.h>

int main()
{
    int n,a,b,rem;
    scanf("%d %d %d", &n,&a,&b);
    rem=n-a;
    if(rem==b)
        printf("%d", n-a);
    else
        printf("%d", (n-a)+((n-a)-(b+1)));
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    printf("%d",a+1);
    return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b,p;
         scanf("%d%d%d",&n,&a,&b);
	if(n-(a+b)>1)
	{
		p=n-(a+1);
	}
	else
	{
		p=n-a;
	}
		printf("%d",p);
                return 0;
}

#include <stdio.h>

int main() {

	int n, a, b, start, ans;
	int i;

	scanf("%d %d %d", &n, &a, &b);

	start = a+1;

	for (i = start; i <= n; i++)
	{
		if (n-i <= b)
		{
			ans += 1;
		}
	}

	printf("%d", ans);

	return 0;
}

#include <stdio.h>

int main()
{
   int n,a,b,c,d;
   scanf("%d %d %d",&n,&a,&b);
   c=n-a;
   d=n-(a+b);
   if(a+b+1<n)
   {
       printf("%d",c-d);
   }
   else
   {
       printf("%d",c);
   }
   return 0;
}

#include<stdio.h>
int min(int a,int b) {
    if(a<b)
    return a;
    else
    return b;
}
int main() {
    int n,a,b;
    scanf("%d %d %d",&a,&b,&n);
    int r = min(n - a, b + 1);
    printf("%d",r);
    return 0;
}

#include <stdio.h>
int main()
{
    int n,a,b,result;
    scanf("%d %d %d",&n,&a,&b);
    result=n-a;
    if (result<=b+1)
    {
        printf("%d",result);
    }
    else
    {
        printf("%d",b);
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,c,d,ans;
    scanf("%d %d %d",&n,&a,&b);
    c=n-a;
    d=n-c;
    if(d<=b)
    {
        ans=c;
    }
    else
    ans=d;
    printf("%d",ans);
    return 0;
}

#include<stdio.h>
main()
{
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    printf("%d",n-a);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    if(a<=b)
        printf("%d",n-a);
    else
        printf("%d",b+1);
    return 0;
}

#include<stdio.h>
int main()
{
	int n,a,b,p=0,j;
	scanf("%d%d%d",&n,&a,&b);
	for(int j=a+1;j<=n;j++)
	{
		if(n-j<=b) ;
		p=p+1;
	}
	printf("%d",a);
}

#include<stdio.h>
int main()
{
	int n,a,b;
	scanf("%d %d %d",&n,&a,&b);
	if(a+b<n)
		printf("%d\n",n-a);
	else
		printf("%d\n",b);
	return 0;
}

#include <stdio.h>
int main()
{
	int n, a, b, pos;
	scanf("%d %d %d", &n, &a, &b);
	if(b==0)
	{
	    pos = 1;
	}
	else if(a==0)
	{
	    pos=n;
	}
	else
	{
	    pos = 1+((a+b)/2);
	}
	printf("%d", pos);
	return 0;
}

#include<stdio.h>
int main()
{
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	if(b>c)
	{
		if(c==0)
		printf("%d",c+1);
		else
		printf("%d",c);
	}
	else
	{
		if(c=b)
		{
			if(b+1<a-b)
			printf("%d",b+1);
			else
			printf("%d",a-b);
		}
		else
		{
			printf("%d",c);
		}
	}
	return 0;
}

#include<stdio.h>
int main(){
    int a,b,c,d,f;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    d=a-c;
    if(d!=b){
        printf("%d",d);
    }
    else{
        f=a-(c-1);

    printf("%d",f);
    }
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,a,b,count=1,i;
    scanf("%d%d%d",&n,&a,&b);
    for(i=a;i<=b;i++)
    {
        count++;
    }
    printf("%d",count);
    return 0;
}

#include <stdio.h>

int main(){
  int n, a, b;
  scanf("%d %d %d", &n, &a, &b);
  int result = n - a;
  printf("%d\n", result);
  return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,c,d,ans;
    scanf("%d %d %d",&n,&a,&b);
    c=n-a;
    d=n-c;

    if(d<=b)
    {
        ans=c;
    }
    else
    ans=d+1;
    printf("%d",ans);
    return 0;
}

#include<stdio.h>
#include<math.h>

int main()

{
    int n,a,b,c,e,i,j;

    scanf("%d %d &d",&n,&a,&b);
    c=n-a;
    i=b;
    j=a;

    if(c>=i)
    {
        e=n-i;
    }
    else
    {
        e=n-j;
    }
    printf("%d",e);
    return 0;

}

#include <stdio.h>

int main(){
  int a,b,c,count = 0;
  scanf("%d %d %c", &a,&b,&c);
  a++;
  for(int i = 0; i <=a; i++){
    if(i >= b && (a-1)<= c) count++;
  }
  printf("%d\n", count);
  return 0;
}

#include<stdio.h>

int main(void)
{
    int n, a, b;

    scanf("%d %d %d", &n, &a, &b);

    printf("%d", (a > b) ? a + 1 : b + 1);

    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d %d %d\n",&n,&a,&b);
    int c=0,s,v;
    for(int i=1;i<=n;i++)
    {
      s=n-a;
      v=b+1;
      if(s<v)
      c=c+1;
    }
    printf("%d\n",c);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main(){

    int n;
    int a,b;
    int result;
    int i=0;

    scanf("%d%d%d",&n,&a,&b);
    if(n<a+b)
        printf("%d",n-a);
    else if(n>a+b)
        printf("%d",b+1);
    else
        printf("%d",n);

    return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,r,k;
    scanf("%d %d %d",&n,&a,&b);
    r = n-a;
    k=a+b;
    if(a==b){
        printf("%d\n",n-a);
    }
   else if(k==n){
        if(a>b){
            printf("%d",++b);
        }
        if(b>a){
            printf("%d\n",++a);
        }
    }

   else if(k!=n){
        printf("%d\n",++b);
    }
    return 0;
}

#include <stdio.h>

int main()
{
      int n,a,b;
      scanf("%d%d%d",&n,&a,&b);
      if(a+b<=n){
             printf("%d",b);
      }else {
              printf("%d",n-a);
      }
       return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b,c,d,ans;
    scanf("%d %d %d",&n,&a,&b);
    c=n-a;
    d=n-c;
    if(d<=b)
    {
        ans=c;
    }
    else
    ans=d;
    printf("%d",ans);
    return 0;
}

#include<stdio.h>
int main()
{
int n,a,b,d;
scanf("%d%d%d",&n,&a,&b);
d=n-a;
printf("%d",d);
}

#include<stdio.h>
int main()
{
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  printf("%d",a-b);
 return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    int l;
    l=n-a;
    printf("%d", l);
return 0;
}

#include<stdio.h>
int main()
{
      long long int n,a,b,c;
      scanf("%lld %lld %lld",&n,&a,&b);
      printf("%lld",(n-a));
      return 0;
}

#include<stdio.h>
int main(void)
{
    int n, a, b, i, count=0, k;
    scanf("%d%d%d", &n, &a, &b);
    k = (n-(a+1));
    for(i=a; i<n; i++)
    {
        count++;
    }
    if(k > b)
    {
    count = count - (a-b) ;
    }
    if(k<b)
    {
        count = count - (b-a);
    }
    if(k==b)
    {
        count = count;
    }
    printf("%d", count);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
 int n, b, a, i, x, y;
 scanf("%d %d %d", &n, &a, &b);
 if(a>=0 && (n>b && n<=100))
 {
   x=a-b;
   if(x<=0)
     y=n-a;
   else if(b==0)
     y=n-a;
   else if(a==0)
     y=n;
   else
     y=n-(a+x);

 }
 printf("%d", y);

 return 0;
}

#include<stdio.h>
int main()
{
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    if(a<b)
        printf("%d",n-a);
    else
        printf("%d",b+1);
    return 0;
}

#include<stdio.h>

int main()

{

int n, a, b;

scanf("%d %d %d", &n, &a, &b);

if(n-a > 1+b)
printf("%d",n-a);

else
printf("%d", b+1);

return 0;
}

#include<stdio.h>
int main(){
int a,b,n;scanf("%d %d %d",&n,&a,&b);
if(a==0 || (n-a)<a) printf("%d",n-b);
else printf("%d",n-a);
}

#include<stdio.h>
int main()
{
    int n,a,b,i;
    scanf("%d%d%d",&n,&a,&b);
        if(n-b==a)
            printf("%d",a+1);
        else if(n-a==b)
            printf("%d",b);
        else if(n-a>b)
            printf("%d",b+1);
        else if(n-b>a)
            printf("%d",a+1);
    return 0;

}