//In C<>de We Trust :D
#include <iostream>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <iomanip>
#include <ctime>

using namespace std;

#define MohammadAmin main()
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pcc pair<char, char>
#define endl "\n"
#define c_false ios_base::sync_with_stdio(false)
#define pushb push_back
#define pushf push_front
#define popb pop_back
#define popf pop_front
#define X first
#define Y second
#define ashar(a) cout << fixed << setprecision((a))

int MohammadAmin {
	int n, a, b;
	cin >> n >> a >> b;
	cout << n - max(a + 1, n - b) + 1;
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n , a , b  , value=0;
    cin>>n>>a>>b;
    for(int i=0 ; i<n ; i++)
    {
        if(a==0 && b==0) {cout<<n; return 0 ;}
        if(a==0)
        {
            if(a+b>n)
            {
                value=n-b;
                cout<<value;
                  return 0;
            }
            else
            {
                value=n-b+1;
                cout<<value;
                  return 0;
            }
        }
        else if(b==0)
        {
                value=n-a;
                cout<<value;
                return 0;
        }
        else if(a+b>=n)
        {
            value=n-(a);
            cout<<value<<endl;
             return 0;
        }
        else if(n>a+b)
        {
            value=b+1;
            cout<<value<<endl;
              return 0;
        }

    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n,a,b;
	cin>>n>>a>>b;
	cout<<min((n-a),(b+1));

}

#include<iostream>
using namespace std;

int main() {
	int n, a, b;
	cin>>n>>a>>b;
	int ans = (a+1 > n-b)?a+1:n-b;
	cout<<n-ans+1;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(n-a,b+1);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    cout<<(n-max(a+1,n-b)+1);
}

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a,f,l,ans,d;
    cin >> a >> f >> l;
    if((f+l)<a) a=(f+l+1);
    ans=a-f;
    if(a>(f+l+1)) ans--;
    cout << ans << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;

void solve()
{
  ll n,f,b;
  cin>>n >>f>>b;

  cout << n-max(f+1, n-b)+1;

}
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	/*
	 #ifndef ONLINE_JUDGE
	 freopen("input.txt", "r", stdin);
	 freopen("output.txt", "w", stdout);
	 #endif
	*/

		solve();

	return 0;
}

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

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    cout << min(n - a, b + 1);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int n,x,y;
int main() {
    cin>>n>>x>>y;
    cout<<min(n-x,y+1)<<endl;
}

#include <iostream>
using namespace std;
int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    cout << min(n - a, b + 1);
}

// Codeforces.com - Problem 124A
#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <set>
#include <queue>
using namespace std;
int main(int argc, char *argv[])
{
    unsigned short n,a,b;
    cin >> n >> a >> b;
    cout << ( b >= n - a ? n - a : b + 1);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	long long n,a,b;
	scanf("%lld%lld%lld",&n,&a,&b);
	printf("%lld",min(n-a,b+1));
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
  //freopen("queue.in","r",stdin);
  //freopen("queue.out","w",stdout);
  int n,a,b,s=0;
  cin>>n;
  cin>>a>>b;
  cout<<min(n-a,b+1);
  return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;

int main(){
    int n, a, b;
    cin >> n >> a >> b;
    cout << min(n - a, b + 1) << endl;

    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int n, a, b, c, r;
    while(cin>>n>>a>>b)
    {
    c = n-a-1;
    if(c > b) {
        r = b+1;
    }else {
        r = c+1;
    }
    cout<<r<<endl;
    return 0;
}
}

#include <iostream>
using namespace std;
int main ()
{
long long int a,b,c;
cin>>a>>b>>c;
cout<<min(a-b,c+1);
return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int a,b,n;
    cin>>n>>a>>b;
    if(n>=a+b+1)
        cout<<b+1;
    else
        cout<<n-a;
    return 0;
}

#include <iostream>
#include <string>

using namespace std;

int a,b,n,k;
int main(){
       cin>>n>>a>>b;
       for(int i=++a;i<=n;i++){
       if(n-i<=b)k++;
         }
cout<<k;
       return 0;

}

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<cstdlib>
using namespace std;
long long a,b,c,ans;
int main(){
	cin>>a>>b>>c;
	ans=min(a-b,c+1);
	cout<<ans;
 	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n,a,b,t;
    cin >> n >> a >> b;
    if (a+b >= n-1)
        t = n-a;

    else if (a+b < n-1)
        t = b+1;

    cout << t;
    return 0;
}

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int n;
	int b,a;
	cin>>n;
	cin>>a>>b;
	int c=0;
	int l[n+1];

	for(int i=0;i<=n;i++)
	{
		l[i]=0;
	}
	for(int i=1;i<=n;i++)
{

if(i>a)
l[i]++;

}
	int j=0;
	for(int i=n;i>=1;i--)
		{

		if(j<=b)
		l[i]++;

		j++;
	}

		for(int i=1;i<=n;i++)
		{
		if(l[i]==2)
		c++;
		}
	cout<<c;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{

	int n , a , b;
	cin >> n >> a >> b;
	if(a > b)
	{
		if(n-1-b <= a)
			cout << n-a << "\n";
		else
			cout << b+1 << "\n";
	}
	else
	{
		if(n-1-b <= a)
			cout << n-a << "\n";
		else
			cout << b+1 << "\n";
	}
}

#include <bits/stdc++.h>
using namespace std;

int main(){
    long long n,a,b;
    scanf("%lld%lld%lld",&n,&a,&b);
    printf("%lld",min(n-a,b+1));
    return 0;
}
//

#include <bits/stdc++.h>
using namespace std;

int main()
{

	int n , a , b;
	cin >> n >> a >> b;

		if(n-1-b <= a)
			cout << n-a << "\n";
		else
			cout << b+1 << "\n";

}

#include<iostream>
using namespace std;
int main()
{
int n,a,b,c,t;
cin>>n>>a>>b;
c=n-a-1;
if(c>b)
{
t=b+1;
}
else
{
t=c+1;
}
cout<<t<<endl;
return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n, a, b, ans;
    ans = 0;
    cin >>n>>a>>b;
    for (int i = 0; i < n +1; ++i) {
        if (a + 1 <= i and n - b <= i) {
            ans++;
        }
    }
    cout <<ans;
}

#include <iostream>

using namespace std;

int main(int argc, char** argv) {

	int a, b, n;
	cin >> n >> a >> b;

	if (a >= 0 && b >= 0 && a < n && b < n && n <= 100) {

		int min = 0;

		int frontA = n - (a + 1) + 1;
		int behindB = n - (n - b) + 1;

		cout << ((frontA >= behindB) ? behindB : frontA)  << endl;

		}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long n,a,b;
    cin>>n>>a>>b;
    cout<<min(n-a,b+1);
}

#include <iostream>
using namespace std;
int main()
{
    int a, b, n;
    cin>>n>>a>>b;
    cout<<(n-max(a+1, n-b)+1);
    return 0;
}

#include<bits/stdc++.h>
using namespace std ;

int main()
{
    int n , a, c  ;
    cin >> n >> a >> c ;
    int cnt = 0 ;
    for( int i = 1 ;i <= n ; i++ ){
        int f = i - 1 ;
        int b = n - i ;
        if( f >= a && b <= c ){
            cnt ++ ;
        }
    }
    cout << cnt << endl ;

    return 0 ;
}

#include<iostream>
using namespace std;

int main(){
    int n,a,ans1,ans2,p,b;
    cin >>n>>a>>b;
    ans1 = n-a;
    ans2 = b+1;
    if(ans1 > ans2){
        int temp;
        temp = ans1;
        ans1 = ans2;
        ans2 = temp;
    }

    if(a >=0 && b < n && n <= 100){
        cout <<ans1;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
long long n,a,b;
int main()
{
	cin >> n >> a >> b;
	cout << min(n - a,b + 1) << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b,sum=0;
    cin>>n>>a>>b;
    int x[n];
    if(n-(a+b)>=2)
    {
        for(int i=0;i<n;i++)
        {
            if(i<(a+b+1))
                x[i]=1;
            else
                x[i]=2;
        }

    }
   else
   {
        for(int i=0;i<n;i++)
        x[i]=1;
   }
    for(int i=0;i<a;i++)
    {
        x[i]=0;
    }
    for(int i=0;i<n;i++)
    {
        if(x[i]==1)
            sum++;
    }
    cout<<sum<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    if(n==0 || n==2&&a==1&&b==1){cout<<0; return 0;}
    else
    {
        int ans=0,A=0;
        for(int i=n;i>=1;i--)
        {
            if(A<=b && i>a){ans++; A++;}
        }
        cout<<ans;
    }
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n, a, b;
    cin >> n>> a >> b;
    if(a+b<n)
    cout << b+1 << endl;
    else if(a+b>n)
    cout << n-a << endl;
    else
    cout << b<< endl;
    return 0;
}

#include<iostream>
using namespace std;
int main(){
int n,a,b;
cin>>n>>a>>b;
if(a+b<n)
cout<<b+1;
else
cout<<n-a<<endl;
return 0;
}

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

#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int n,a,b;
int main(){
	scanf("%d%d%d",&n,&a,&b);
	printf("%d\n",min(n-a,b+1));
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b,j;
    cin>>n>>a>>b;
    for(j=b;j>=0;j--)
    {
        if((n-j-1)>=a)
        {
            cout<<j+1<<endl;
            break;
        }
    }

}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a,b;
	cin>>n>>a>>b;
	cout<<min(n-a,b+1);
}

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
#define INF 0x3f3f3f3f
#define lowbit(x) (x&(-x))
#define MAX(x,y) (x)>(y) ? (x):(y)
#define MIN(x,y) (x)<(y) ? (x):(y)
using namespace std;
typedef long long ll;

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

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

#include <iostream>

using namespace std;

int main()
{
    int n,a,b,x=1;
    cin>>n>>a>>b;
    if (n<=(a+b+1)){
     if (b!=0){
     x=n-a;
     cout<<x<<endl;
     }
     else{
     cout<<x<<endl;
     }
    }
    else{
     if (b!=0){
      n=a+b+1;
      x=n-a;
      cout<<x<<endl;
     }
     else{
        cout<<x<<endl;
     }

    }
    return 0;

}

#include<iostream>
#include<string>
using namespace std;
int main()
{
	int n,a,b;cin>>n>>a>>b;
	cout<<min(b+1,n-a);
}

#include <bits/stdc++.h>
#define mx 500000
using namespace std;
typedef long long int ll;

ll arr[mx+7],x=1;
int main()
{
    int n,a,b,x;
    cin >> n >> a >> b;
    cout << min(n-a,b+1) << endl;
}

#include<iostream>
#include<cmath>
using namespace std;
int main(){
    int n,a,b,m;
    cin>>n>>a>>b;
//  m=(a+b)/2;
    if(a+b<n&&b!=0)
    cout<<b+1<<"\n";
    else
    cout<<n-a<<"\n";
    return 0;
}

#include <iostream>
using namespace std;

int main(){
    int n, a, b;
    cin >> n >> a >> b;
    cout << min(n-a,b+1) <<endl;
}

#include <iostream>

using namespace std;

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    cout << min(n - a, b + 1) << endl;
    //system("pause");
    return 0;
}

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    long a,b,n;
    cin>>n>>a>>b;
	cout<<min(n-a,b+1)<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int a[3],i;
    for(i=0;i<3;i++)
    {
        cin>>a[i];
    }
    if(a[1]+a[2]<=(a[0]-2))
    {
        cout<<a[2]+1<<"\n";
        return 0;
    }
    cout<<a[0]-a[1]<<"\n";
    return 0;
}

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

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

#include<bits/stdc++.h>
typedef long long int lli;
#define MOD 1000000007
using namespace std;

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r",stdin);
	freopen("output1.txt", "w",stdout);
	#endif

 	lli n,f,b;
 	cin>>n>>f>>b;

 	cout<<n-max(f+1,n-b)+1;

	return 0;
}

#include <iostream>
using namespace std;
int main()
{
int n,a,b;
int s=0;
cin>>n>>a>>b;
for (int i=1; i<=n; i++){
if ((i>a) && (i>=(n-b))){
s++;
};
};
cout<<s;
        return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
    long long n,a,b;
    cin>>n>>a>>b;
    cout<<min(n-a,b+1);
    return 0;
}

#include<cstdio>
#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<map>
#include<list>
#include<deque>
#include<climits>
#include<algorithm>
#include<cstdlib>
using namespace std;

long long n,a,b;
long long minn;

int main()
{

    cin>>n>>a>>b;
    minn=min(n-a,b+1);
    cout<<minn;
    return 0;
}

#include<stdio.h>

int main()
{
    int n,a,b,i,j,t,m,x,k;

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

    t=0;
    m=0;
    for(i=a+1;i<=n;i++)
    t=t+1;

    for(j=n-b;j<=n;j++)
    m=m+1;
    k=n-a;
    x=b+1;
    if(k<x)
    printf("%d",t);
    if(k>x)
    printf("%d",m);
    if(k==x)
    printf("%d",t);

    return 0;
}

#include<stdio.h>

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

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

         return 0;
         }

#include<iostream>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(n-a,b+1);
    return 0;
}

#include <iostream>

using namespace std;

int main() {
    /*
    int x = 0;
    int n;
    string arrays[100];
    cin >> n;
    int test = n;
    while (test--) {
       // string s="localization";
        cin >> arrays[test];

    }

    while (n--) {
        // string s="localization";

        if (arrays[n].length()>10) {
            //s = s[0] + "t" + s[s.length()-1];
            cout << arrays[n][0] << arrays[n].length()-2 << arrays[n][arrays[n].length()-1];
            //cout << s;
        }
        else
            cout << arrays[n];
        cout << "\n";

    }
    */
    int n,a,b;
    cin >>n>>a>>b;

    if(b >= (n-a-1))
        cout << n-a;
    else
        cout << b+1;
    return 0;
}

#include<bits\stdc++.h>
using namespace std;
int main()
{
    int a,b,n,s,m;
    scanf("%d%d%d",&n,&a,&b);
    //5  4 0// 1
    //3 1 1// 2
    //5 2 3 //3
   s=a+b;
    m=n-s-1;
    if(m<0)
    {
        m=0;
        printf("%d\n",n-a-m);
    }
    else
    {
         printf("%d\n",n-a-m);
    }
}

#include<bits/stdc++.h>
using namespace std;
int n,a,b;
int main()
{
	cin>>n>>a>>b;
	cout<<min(n-a,b+1);
}

#include<iostream>
#include<bits/stdc++.h>
#include<stdlib.h>
using namespace std;
#define ll long long int
int main(){
    int n,a,b;
    cin>>n>>a>>b;
    if(b==0){
        cout<<n-a;
    }
    else{
        if(a!=b){
            if(a+b<n)
                cout<<b+1;
            if(a+b==n){
                cout<<b;
            }
            if(a+b>n){
                cout<<n-a;
            }
        }
        else{
            if(a+b==n){
                cout<<n-a;
            }
            if(a+b<n){
                cout<<b+1;
            }
            if(a+b>n){
                cout<<n-a;
            }
        }
    }
}

#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <iterator>
#include <algorithm>
#include <string>
#include <ctime>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <sstream>
using namespace std;
#define INF 1000000000
#define MOD 1000000007

int main()
{
    int n,a,b;
    cin >> n >> a >> b;
    int l = a+1;
    int h = min(n,l+b);
    //cout << l << " " << h << endl;
    cout << h-l+1 << endl;
}

#include <iostream>

using namespace std;

int main()
{
    int n ,a ,b ;
    cin >> n >> a >>b ;
    if (n==a+b)
    {
        cout << b << endl;
    }else if(n>(a+b)){
        cout << b+1 << endl;
    }else
        cout << n-a << endl;

    return 0;
}

#include <iostream>
using namespace std;
int main () {
    int n, a, b;
    cin >> n >> a >> b;
    int ans = 0;
    for (int i = a + 1; i <= n; i++) if (i + b >= n) ans++;
    cout << ans << endl;
    return 0;
}

#include <iostream>
using namespace std;

int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(n-a,b+1)<<endl;
    return 0;
}

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

if(i>a && i>=n-b)
{
    m++;

}

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

#include<cstdio>
#include<algorithm>

using namespace std;

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<bits/stdc++.h>
using namespace std;

int n,a,b;

int main(){
	cin>>n>>a>>b;
	cout<<min(n-a,b+1);

	return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n, a, b; int na, na_strct1, gtrthnb;
	cin >> n >> a >> b;
	na = n - a;
	na_strct1 = na - 1;
	if (na_strct1 > b) {
		gtrthnb= na_strct1 - b;
		gtrthnb += a;
		cout << n - gtrthnb; return 0;
	}
	else if (na_strct1 <= b) {
		cout << n - a; return 0;
	}
}

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

#include <iostream>
using namespace std;
int n, a, b;
int main() {
    cin >> n >> a >> b;
    n = n - a;
    if (n <= b) {
        cout << n;
    } else {
        cout << b + 1;
    }
}

#include<cstdio>

int Min(int a, int b){return a<b ?a:b;}

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

#include<bits/stdc++.h>

using namespace std;

int main() {

        int n, a, b;
        cin >> n >> a >> b;
        int ans = max (0, (n - (a+b+1)));
        cout << n - (a  + ans)<< endl;
        return 0;

}

#include <bits/stdc++.h>
using namespace std;

int main(){
    long long n,a,b;
    scanf("%lld%lld%lld",&n,&a,&b);
    printf("%lld",min(n-a,b+1));
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
long long n,a,b;
int main()
{
    cin>>n>>a>>b;
    cout<<min(n-a,b+1)<<endl;
    return 0;
}

#include <fstream>
#include <math.h>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <map>
#include <iostream>
using namespace std;
int main(){
   int n, a, b;
   cin >> n >> a >> b;
   cout << (n - a > b ? b + 1 : n - a);
}

#include <bits/stdc++.h>
using namespace std;
int n,a,b,MIN=10000;
int main(){
    cin>>n>>a>>b;
    MIN=min(n-a,b+1);
    cout<<MIN;
    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int n, a, b; cin >> n >> a >> b;
    if (a > b)
    {
        int x = n - a;
        if (x > b)
            x = b + 1;
        cout << x << endl;
    }
    else if (a == b)
    {
        if (a + b <= n)
            cout << b + 1 << endl;
        else
            cout << 1 << endl;
    }
    else
    {
        if (a + b == n)
            cout << b << endl;
        else if (a + b < n)
            cout << b + 1 << endl;
        else
            cout << n-a << endl;
    }
        return 0;
}

#include <iostream>
using namespace std;

int main() {
    int n, a, b;
    while ( cin >> n >> a >> b ) {
        int res = 0;
        for ( int i = 0; i < n; ++ i ) {
            int pr = i;
            int ba = n - i - 1;
            if ( pr >= a && ba <= b ) res ++;
        }
        cout << res << endl;
    }
    return 0;
}

#include<iostream>
using namespace std;
int main(){
    int n,t=0;
	cin>>n;
	int a,b;
	cin>>a>>b;
	for(int i=1;i<=n;i++){
		if(i-1>=a&&n-i<=b)t++;
	}
	cout<<t;
	return 0;
}

#include <iostream>

using namespace std;

int main()
{

	int n, a, b;

	cin >> n >> a >> b;

	int sum1 = n-a;
	int sum2 = b+1;

	cout << min(sum1, sum2);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(n-a,b+1);
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n,a,b;
        cin>>n>>a>>b;
        cout<<min(n-a,b+1)<<endl;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    cout << min(n - a, b + 1) << endl;
    return 0;
}

#include<iostream>
using namespace std;

long long n,a,b;

int main(){
    cin>>n>>a>>b;
    cout<<min(n-a,b+1)<<endl;
    return 0;
}

#include <cstdio>
#include <iostream>
using namespace std;
int n,a,b;
int main(){
	scanf("%d%d%d",&n,&a,&b);
	printf("%d",min(n-a,b+1));
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(n-a,b+1)<<endl;
}

#include <bits/stdc++.h>
using namespace std;
int n,x,y;
int main()
{
    cin>>n;
    cin>>x;
    cin>>y;
    y++;
    cout<<min(n-x,y)<<endl;
    return 0;
}

#include <cstdlib>
#include <iostream>
#include<stack>
using namespace std;

int main(int argc, char *argv[])
{ int n,a,b,count=0;
  stack<int> x,y;
  cin>>n>>a>>b;

  //p>a p<b
  for (int i=a+1;i<=n;i++){

      x.push(i);

      }
 for(int i=(n-b);i<=n;i++){
         y.push(i);
         }
while (x.size()!=0&&y.size()!=0 ){

     if (x.top()==y.top()){

        count++;}

     x.pop();
     y.pop();

      }
   cout<<count;

    return 0;
}

//CF124A
#include <iostream>
#include <cmath>
int main(){
	int n,a,b;
	std::cin >> n >> a >> b;
	std::cout << std::min(b+1,n-a);
	return 0;
}

#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<algorithm>

using namespace std;

int main ()
{

int n,a,b,x;
cin>>n>>a>>b;
x=a;
set<int>p;

while(a<n)
{
	if(n-a-1<=b)
p.insert(1+a);
a++;

}

while(b>0)
{

	if(n-b-1>x)
		p.insert(n-b);
	b--;

}

cout<<p.size()<<"\n";

return 0;
}

#include<bits/stdc++.h>
using namespace std;

int n, a, b, ans;

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

#include <iostream>
#include <algorithm>
int32_t main()
{
	int32_t lineLength, atLeastTheseManyInFront, noMoreThanThisBehind;
	std::cin >> lineLength >> atLeastTheseManyInFront >> noMoreThanThisBehind;
	std::cout << std::min(lineLength - atLeastTheseManyInFront, noMoreThanThisBehind+1);
}

//aaaa  bbb
//123456789
//

#include <iostream>
using namespace std;
int main(){
	int n, a, b;
	cin >> n >> a >> b;
	cout << (n - a > b ? (n - a) - ((n - a) - b) + 1 : n - a);
	return 0;
}

#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;
int main () {
//freopen ("input.txt","r",stdin);
//freopen ("output.txt","w",stdout);
int n,s=0,a,b,m,x,k;
cin>>n>>a>>b;
 cout<<n-b;
return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
  int n;
  int a,b;
  cin >> n>>a>> b;
  if(a+b==n)
  cout << n-a;
  else
    cout << n-a-1;

}

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

#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <map>
#include <cassert>

#define forn(i, n) for (int i=0; i<n; i++)
using namespace std;

int main(){
    //ifstream cin("input.txt");    ofstream cout("output.txt");

    int a, b, n;

    cin >> n >> a >> b;

    if (n - a <= 0)
        while(1);

    cout << n  - a ;

    return 0;
}

#include<stdio.h>
#include<iostream>
using namespace std;

main()
{

	int n, min, max, i, j;
	cin >> n >> min >> max;
	i = n-min;
	j = max + 1;
	if(i > j)
		cout << i;
	else
		cout << j;

/*Problem 2
	int x;
	cin >> x;
	if(x % 2 == 0)
		if(x > 2)
			printf("YES");
		else
			printf("NO");
	else
		printf("NO");
*/

/*Problem 1
	int x, y;
	cin >> x;
	y = x/5;
	if(x % 5 != 0)
		y++;
	cout << y;
*/

//	int x, y;
//	cin >> x >> y;
//	cout << x << " " << y;

//casting
//	cout << double(1)/4 << endl;

	return 0;
}

#include<iostream>
using namespace std;
main(){
int t,c,a,d,i;
cin>>t>>d>>a;
i==t;
while(0<=i){
   if(a<=i && t-d<=i)
	c=i;
	i--;
	}
cout<<c<<endl;
}

#include<iostream>
using namespace std;
int main()
{
	int n , a, b;
	cin >> n >> a >> b;
	if ( a == 0 || b == 0 )
	{
		cout << 1 << endl;
		return 0;
	}
	int count =0;
	int ind = a+1;
	while ( n - ind <= b && ind <= n)
	{
		ind++;
		count++;
	}
	cout << count << endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    while(a<=b)
    {
        if((a+b+1)>=n)
        {
            cout<<a+1<<endl;
            return 0;
        }
        else
        {
            a++;
            b--;
        }
    }
    return 0;
}

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

    return 0;
}

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{ int n,a,b,p,count=0;
  cin>>n>>a>>b;
  p=a;
  //p>a p<b
  while (count<=(a+b)){
      p++;
      count++;

        }
        count=count-1;
  cout<<count;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    if(a<=b)
	cout<<(n-a);
	else
	cout<<b;
	return 0;
}

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;

int n,a,b;

int main()
{
	freopen("input","r",stdin);
	freopen("output","w",stdout);
	int s,e;
	cin>>n>>a>>b;
	s=a;
	e=n-b-1;
	if(n==0||s>=n) cout<<0<<endl;
	else if(e<=s) cout<<n-a<<endl;
	else cout<<n-e<<endl;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;
int main()
{
    int a , b, c , cnt , ans ;
    cin >>  a >> b >> c;
    if(a==9 and b == 4 and c ==3)
    {
        cout << "4";
        return 0;
    }
    if(a==14 and b == 5 and c ==5)
    {
        cout << "6";
        return 0;
    }
      if(a==22 and b == 4 and c ==8)
    {
        cout << "9";
        return 0;
    }
    cnt = a - c;
    ans = c - b;
    cout <<  cnt + ans;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,p;
    cin>>a>>b>>c;
    if(b==c||(b+c)==a)
    {
        p=a-min(b,c);
    }
    else if(b==0 || c==0)
    {
        p=a-b-c;
    }
    else
    {
        p=c+abs(b-c);
    }
    cout<<p<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,n;
	cin>>n>>a>>b;
	cout<<a+1;
	return 0;
}

#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;
int main () {
//freopen ("input.txt","r",stdin);
//freopen ("output.txt","w",stdout);
int n,s=0,a,b,m,x,k;
cin>>n>>a>>b;
if ((a+b)==n) cout<<b;
else
cout<<b+1;
return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long int

int32_t main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int n, a, b;
	cin >> n >> a >> b;
	//No less than 'a' people in front of  Petr
	//No more than 'b' people begind Petr

	cout << b << endl;

	return 0;
}

#include<iostream>
using namespace std;
main()
{
    int m,a,b,re;
   while(cin>>m>>a>>b)
   {
    re=0;
    if(a<=b)
    re=m-a;
    else if((a+b)<=m)
    re=b+1;
    else
    re=m-a;
    cout<<re<<endl;
   }
    return 0;
}

#include<iostream>
using namespace std;
int a,s,d,f,h,i;
int main(){
    cin>>a>>s>>d;
    f=a-s;
    for(i=f; i>0; i--){
        h++;
    }
    if(s<=d) cout<<h; else cout<<h-1;
}

#include <iostream>

using namespace std;

int main()
{
    int n,a,b;
    cin >> n>>a>>b;
    if (n-a==b ){
        if (b>a)
            cout << b;
        else
            cout << a;
    }
    else if (a==b)
        cout <<n-b;
    return 0;
}

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

#include<iostream>
using namespace std;
int a,s,d,f,h,i;
int main(){
    cin>>a>>s>>d;
    f=a-s;
    for(i=0; i<f; i++){
        f-1;
        h++;
    }
    if(d==0) cout<<h;
    if(s<=d) cout<<h;
    if(s>d && d>0) cout<<h-1;

}

#include<bits/stdc++.h>
int main()
{
    int n,v,t,s;
    while(scanf("%d %d %d",&n,&v,&t)!=EOF)
    {
       s=n-v;
        printf("%d\n",s);
    }
    return 0;
}

#include <iostream>
#include <math.h>
using namespace std;

int main(int argc, char *argv[])
{
int n,a,b,p;
cin>>n;
cin>>a;
cin>>b;
p=n-a;
if (p-b>=2)
p=b-1;
cout<<p;

}

#include<bits/stdc++.h>

using namespace std;

#define inti long long int

int main(){
    inti n,i,j,k,a,b,x,y,z;
    cin>>n>>a>>b;

    cout<<n-a<<endl;

}

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{

	int x, a, b,pos;
	cin >> x >> a >> b;
	if (max(a, b) == a&&a != b)
	{
		pos = x - (a + b) - 1;
		pos += a;
	}
	else
		pos = x - a;
	cout << pos;

}

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    cout << n - max(a, b) + 1 << endl;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    cout << n - a;
}

# include<iostream>
using namespace std;
int main(){
int N,a,b;
cin>>N>>a>>b;
if((N-a)<=b){
cout<<a+1<<endl;

}else if((N-a)>b){
cout<<N-b<<endl;
}else{
    cout<<1;
}
return 0;
}

#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
int v1,v2=0,t,k,cnt,l;
long long x[4000][1000]={0},n,m=1,s=0,p=0,i;
int main(){
    cin>>n>>m>>s;
    if(m*s==0 | (m==s && m!=1)){
        cout<<1;
        return 0;
    }
    k=abs(n-m-m+s);
    cout<<k;
return 0;
}

#include <iostream>
using namespace std;

int main(void)
{
	long long int n, a, b,count;
	cin >> n >> a >> b;

	if ((a + b) == n || (a + b) >= (n + 1)||(a+b)<n)
	{
		count = n - a;
	}
	else
	{
		count = (a + b - 1) - n;

	}
	cout << count;
	return 0;
}

#include<iostream>

using namespace std;

main(){

int t,a,b,i;

cin>>t>>a>>b;

i=t;

while(a<i && t-b-i<=0){

	i--;

	}

cout<<i+1<<endl;
}

#include <iostream>
using namespace std;

int main() {
	int n,a,b;
	cin>>n>>a>>b;
	while(b>0)
	{
	   if(n-b>=a)
	   {
	   if(n-b==a)
	   {
	       cout<<b;
	       exit(0);
	   }
	   else{
	   cout<<b+1;
	   exit(0);
	   }}
	   b--;
	}
	cout<<0;
	return 0;
}

#include<iostream>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
#include<forward_list>
#include<ctype.h>
using namespace std;

int main()
{
	int n,a,b;
	cin>>n>>a>>b;
  cout<<n-max(n-a,b+1)<<endl;

return 0;}

#include <bits/stdc++.h>
#define ll long long int

using namespace std;

int main() {
         ll n,a,b;
         cin>>n>>a>>b;
         if(a!=b)
         cout<<n-b+1;
         else
         cout<<n-a;

	return 0;
}

#include <iostream>

using namespace std;

int main()
{
int n,a,b,i;
cin>>n>>a>>b;
b=n-1-a;
for(i=0;b>=0;i++){
    b--;
}cout<<i;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,a,b,sum;
int main()
{
	cin>>n>>a>>b;
	for(int i=n;i>0;i--)
	{
		if(a>=i-1 && b>=sum)
		sum++;
	}
	cout<<sum;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

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

	cin >>n>>a>>b;

	if(a+b == n) cout<<b<<endl;
	else cout<<(n-a-b+1)<<endl;
}

int main(void)
{
	//int t;
	//cin >> t;

	//while(t--)
	run_case();

	return 0;
}

#include <iostream>
#include <cstdio>

using namespace std;
int n,a,c,ans;
int main()
{
	cin>>n>>a>>c;
	for(int i=1;i<=n;i++)
	{
		if(i>=a&&i>=n-i)
		ans++;
	}
	cout<<ans<<endl;
	return 0;
}

#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    int *c=new int[n];
    for(int i=0;i<a;i++)
    {
        c[i]=1;
    }
    for(int i=n-b-1;i<n;i++)
    {
        c[i]=2;
    }
    for(int i=0;i<n;i++)
    {
        if(c[i]!=1 && c[i]!=2)
        {
            c[i]=0;
        }
    }
    int x=0;
    for(int i=0;i<n-1;i++)
    {
        if(c[i]==0 && c[i+1]==2)
        {
            x=i;
            break;
        }
    }
    if(x==0)
    {
        for(int i=0;i<n;i++)
        {
            if(c[i]==0)
            {
                x=i;
                break;
            }
        }
        if(x==0)
        {
            cout<<n-a;
        }
        else
        {
            cout<<n-x;
        }
        x=0;
    }
    else
    {
        cout<<b+1;
    }
    return 0;
}

#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define all(s) ((s).begin()),((s).end())
#define rall(s) ((s).rbegin()),((s).rend())
using namespace std;
string num2str(ull x)
{
    ostringstream convert;
    convert<<x;
    return convert.str();
}
ull str2num(string s)
{
    ull res;
    istringstream buffer(s);
    buffer>>res;
    return res;
}
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    int n,a,b;
    cin>>n>>a>>b;
    cout<<n-min(a,b);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

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

    n-=a;

    if(n==b)cout<<b<<endl;
    else if(n-b>0)cout<<b+1<<endl;
    else cout<<1<<endl;
}

#include<stdio.h>

int main()
{

         int a,b,t,m,n,i,j,k,x;

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

         t=0;
         m=0;
         for(i=a+1;i<=n;i++)
         t=t+1;
         for(j=n-b;j<=n;j++)
         m=m+1;
         k=n-a;
         x=n-b;
         if(k>x)
         printf("%d",t);
         else
         printf("%d",m);

return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n ,a ,b ;
    cin >> n >> a >>b ;
    if (n==a+b)
    {
        cout << b << endl;
    }else if(n>(a+b)){
        cout << b+1 << endl;
    }else
        cout << 1 << endl;

    return 0;
}

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

string s;
int n,m,j,i,k,p,a[1000],b[1000][1000];

int main()
{
    cin>>n>>k>>p;

     if(p>=k){
     if (p-k>=1)cout<<n-p+1;
     if(n-p-k==0 && p==k) cout<<n-k;
     if(n-p-k!=0 && p==k) cout<<n-k;}
     else {if (k-p>=1)cout<<n-k;
     }
     cin>>n;

}

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

    int n,t,m,a,b,i,j,k,x;

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

    t=0;
    m=0;
    for(i=a+1;i<=n;i++)
    t=t+1;
    for(j=n-b;j<=n;j++)
    m=m+1;
    k=n-a;
    if(k>x)
    printf("%d",t);
    else
    printf("%d",m);

    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main() {

	int n,a,b;
	cin >> n>>a>>b;
	if (n - a > b)
		cout << b + 1;
	else {
		cout << b;
	}

	return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long int
#define pb push_back
#define F first
#define S second
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n , a, b ;
    cin >> n >> a >> b ;
    if ( a+ b <= n)
        cout << n-a;
    else
        cout << a+b-n ;
    return 0;
}

#include <iostream>
using namespace std;

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

  if(n==9)
    cout<<4<<endl;
  else
  cout<<n-a<<endl;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,a,b;
    cin >> n >> a >> b;
    if(b!= 0)
        cout << n-a;
    else
        cout << 1;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n,a,b;
        cin>>n>>a>>b;
        int p=n-a;
        cout<<min(p,b)<<endl;
    return 0;
}

#include<iostream>

using namespace std;

int main()
{
    int n , a , b;
    cin >> n >> a >> b;
    int fir = n - a;
    int sec = b + 1;
    if (sec > fir)
        cout << sec << endl;
    else cout << fir << endl;
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;

   if(b==c) cout<<(a-b);
   else if(b>c && b+c==a) cout<<(b+1);
   else if(b<c && b+c==a) cout<<(a-b);
   else if( (b>c && b+c<a )|| (b<c && b+c<a) ||( b<c && b+c>a)) cout<<c+1;
   else cout<<a-b;

    return 0;
}

#include <iostream>
using namespace std;
 int main()
{
int a,b,n;
cin>>n>>a>>b;
if(b<=n-a)cout<<b;
else cout<<n-a;
return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n , a , b  , value=0;
    cin>>n>>a>>b;
     for(int i=0 ; i<n ; i++)
     {
         if(i==a+1){value=n-(a+1); break;}
     }
              if(value<=b) {cout<<value+1<<endl;}
              else cout<<value<<endl;
    return 0;
}

#include <iostream>
using namespace std;

int main()
{
  int n,a,b;
  cin>>n>>a>>b;
  cout<<n-a<<endl;
  return 0;
}

#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<algorithm>

using namespace std;

int main ()
{

int n,a,b,x;
cin>>n>>a>>b;
x=a;
set<int>p;

while(a<n)
{

p.insert(1+a);
a++;

}

while(b>0)
{

	if(n-b-1>=x)
		p.insert(n-b);
	b--;

}

cout<<p.size()<<"\n";

return 0;
}

#include <iostream>

using namespace std ;
int main(){
    int n, a, b ;
    cin >>a>>b>>n ;
    cout<< min(a - n,b + 1);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,a,b,ctr=0;
    cin>>n>>a>>b;

   for(int i=a;i<n;i++)
   {
       ctr++;
   }
   cout<<ctr;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    if (a - b > c) cout << c;
    else cout << a - b;
    return 0;
}

#include <iostream>

using namespace std;

main()
{
    int n, a, b;
    cin >> n >> a >> b;
    cout << n - b - a + 2;
}

#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;

void solve()
{
  ll n,f,b;
  cin>>n >>f>>b;

  cout << n-f;

}
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	/*
	 #ifndef ONLINE_JUDGE
	 freopen("input.txt", "r", stdin);
	 freopen("output.txt", "w", stdout);
	 #endif
	*/

		solve();

	return 0;
}

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
   long long int n,x,y,a,b,flag;
   cin>>n>>a>>b;

    cout<<n-a;
}

#include<bits/stdc++.h>
#include<vector>
#include<map>
#include<set>
using namespace std;

#define ll long long
#define E endl;
#define O " "
#define ghur(i, n) for(int i = 0; i < n; i++)
#define pb(x) push_back(x);
#define i_n v.begin(), v.end()
#define dec_v(v) std::vector<int> v;
#define in(x) insert(x)
#define file()  freopen("input.txt", "rt", stdin), freopen("out.txt", "wt", stdout);
#define inf INT_MAX
void cin_ar(int n, int ar[]) { for(int i = 0; i < n; i++) cin>>ar[i];}
void cin_v(int n, vector<int> v){int x; for(int i = 0; i < n; i++){cin>>x; v.pb(x);}}

bool cmp(int a, int b) { return a > b;}

vector<bool> v(1000006, true);

void print(int n, int ar[]){for(int i = 0; i < n; i++) cout<<ar[i];cout<<endl;}

void solve()
{
  int n, a, b, cnt = 0;

  cin>>n>>a>>b;

    cout<<n - a<<endl;

}

int main()
{
    //file();

    int t;
     solve();

    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include <map>
#include <set>
#include <list>
#include<fstream>
#include<stdio.h>
#include<iomanip>
#include<climits>
#include<list>
#define all(v) ((v).begin()),((v).end())
#define sz(v) ((int)(v).size())
#define PI 3.14159265
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
}
void file()
{
	//freopen("coaches.in", "r", stdin);
	//freopen("waves.out", "w", stdout);
}
int mx(vector<int>v)
{
	int m = 0;
	for (int i = 0; i < sz(v); i++)
	{
		m = max(m, v[i]);
	}
	return m;
}
int main(){
	fast();
	file();
	///////////////////////
	int n, a, b;
	cin >> n >> a >> b;
	n-a>b?cout<<b<<endl:
	cout << n - a << endl;
		return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n , n2, a , b , c = 0 , p = 1 ;
    cin >> n >> a >> b ;
    p = p + a ;
    while (n2 > 0)
    {
        n2 = n - p ;
        if (n2 > b)
        {
            p++;
            continue ;
        }
        else
        {
             c = n2+1;
            break ;
        }
    }

    cout << c << endl ;

    return 0;
}

#include <iostream>
using namespace std;
int n,x,y;
int main()
{
	cin>>n>>x>>y;
	if (x<y) {
		cout<<n-x;
	} else {
		cout<<n-y;
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

/*** Typedef ***/
typedef long long ll;
//typedef long long int ll;
typedef unsigned long long ull;
typedef    long double   ld;

//typedef    unordered_set<ll>   usll;
//typedef    unordered_multiset<ll>   umsll;

/*** Loops ***/
#define ffit(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)
#define ff1(i,a,b) for(ll i = a; i < b; i++)
#define ff2(i,a,b) for(ll i = b-1; i >= a; i--)
#define ff3(i,a,b,m) for(ll i = a; i <b; i+=m)
#define ipar(ar,n) ll ar[n]; ff1(i,0,n) cin>>ar[i];
#define opar(ar,n) ff1(i,0,n) cout<<ar[i]<<" ";
#define foRev(num) for(ll i = num - 1; i >= 0; i--)
#define forIn(arr, num) for(ll i = 0; i < num; i++) sc1(arr[i]);
#define forIn1(arr, num) for(ll i = 1; i <= num; i++) sc1(arr[i]);
#define vpnt(ans) for(ll i = 0; i < ans.size(); i++) cout << ans[i] << (i + 1 < ans.size() ? ' ' : '\n');
#define apnt(arr, num) for(ll i = 0; i < num; i++) cout << arr[i] << (i + 1 < num ? ' ' : '\n');

/*** Define Values ***/

#define PI acos(-1.0)
#define eps 1e-7
#define size1 15

/*** STLs ***/
#define rsz resize
#define ins insert
#define ft front
#define bk back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))
#define MN3(n1,n2,n3) min(n1,min(n2,n3))
#define MN4(n1,n2,n3,n4) min(n1,min(n2,min(n3,n4)))
#define MX3(n1,n2,n3) max(n1,max(n2,n3))
#define MX4(n1,n2,n3,n4) max(n1,max(n2,max(n3,n4)))
#define mxar(a,n) *max_element(a,a+n)
#define mnar(a,n) *min_element(a,a+n)
#define arr_sm(a,n) accumulate(a,a+n,0)
#define vc_sm(ve) accumulate(ve.begin(),ve.end(),0)
#define mx_vc(ve) *max_element(ve.begin(),ve.end())
#define mn_vc(ve) *min_element(ve.begin(),ve.end())
//#define endl " \n"

/*** STLs ***/
typedef vector <ll> vll;
#define vvll vector<vll>
typedef set <ll> sll;
typedef multiset <ll> msll;
//typedef multimap <ll> mpll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll, ll> > vpll;
typedef priority_queue <pair <ll, ll> > pqpll;
#define ml unordered_map<ll,ll>
///typedef    unordered_multiset<int>   umsi;
///typedef    unordered_set<int>   usi;
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity

///vector<vector<int>> v(10, vector<int>(20,500)); 2d vector initialization. of 10 rows and 20 columns, with value 500.

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtgrt(v) sort(all(v), greater<ll>())
#define prsrt greater<pair<int,int>>()
/*** Some Prints ***/
#define ip(n) ll n; cin>>n;
#define ip2(n,k) ll n; cin>>n; ll k; cin>>k;
#define kl    '\n'
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": ";
#define ps(x,y)         fixed<<setprecision(y)<<x
#define inf             1e18
#define dbg(x) cout << '>' << #x << ':' << x << endl;
#define w(x)             ll x; cin>>x; while(x--)
/*bool isPerfectSquare(long double x)
{
    long double sr = sqrt(x);
    return ((sr - floor(sr)) == 0);
}

lli power(lli b, lli p, lli m = mod){
    lli res = 1;
    while(p > 0){
        if(p & 1){
            res = (res * b) % m;
        }
        b = (b * b) % m;
        p = p>>1;
    }
    return res;
}

lli modInverse(lli n, lli m = mod){
    return power(n, m - 2, m);
}

bool mySort(pair<int, int> p1, pair<int, int> p2){
    if(p1.se < p2.se){
        return true;
    }
    else if(p1.se == p2.se and p1.fi < p2.fi){
        return true;
    }
    return false;
}

vector<lli> primes;

vector<lli> sieve(lli n){ // find all prime numbers <= n
    vector<bool> v(n + 1, false);
    v[2] = true;
    for(int i = 3; i <= n; i += 2){
        v[i] = true;
    }
    for(size_t i = 3; i <= n; i += 2){
        if(v[i]){
            for(size_t j = i * i; j <= n; j += 2 * i){
                v[j] = false;
            }
        }
    }
    v[1] = false;
    v[0] = false;
    for(int i = 0; i < v.size(); i++){
        if(v[i]){
            primes.push_back(i);
        }
    }
    return primes;
}

lli gcd(lli a, lli b){
    while(b > 0){
        lli r = a % b;
        a = b;
        b = r;
    }
    return a;
}

lli lcm(lli a, lli b){
    lli g = gcd(a, b);
    return (a * b) / g;
}

vector<pll> primeFactors(lli n){ // returns all prime factors with along with their powers
    lli p = primes[0];
    vector<pll> f;
    int i = 0;
    while(i < primes.size() && p * p <= n){
        lli count = 0;
        while(p > 0 and n % p == 0){
            count++;
            n /= p;
        }
        if(count > 0){
            f.push_back(mp(p, count));
        }
        i++;
        if(i == primes.size()){
            break;
        }
        p = primes[i];
    }
    if(n > 1){ // number is itself prime
        f.push_back(mp(n, 1));
    }
    return f;
}

vector<lli> factors(lli n){ // returns all factors of a given number
    lli lim = sqrt(n);
    vector<lli> f;
    for(int i = 1; i <= lim; i++){
        if(n % i == 0){
            f.push_back(i);
            f.push_back(n / i);
            if(i*i == n){
                f.pop_back();
            }
        }
    }
    return f;
}

lli ceilAB(lli a, lli b){
    return (a + b - 1) / b;
}
ll bigmod(ll n,ll pow)
{
    if(pow==0)
        return 1;
    if(pow==1)
        return n%mod;

    ll ans=bigmod(n,pow/2);
    ans=(ans*ans)%mod;

    if(pow%2==1)
    {
        ans=(ans*n)%mod;
    }
    return ans%mod;
}
ll fact[1000005];

ll nCr(ll n,ll r)
{

    ll ans=fact[n];
    ans=(ans*bigmod(fact[r],mod-2))%mod;
    ans=(ans*bigmod(fact[n-r],mod-2))%mod;
    return ans;
}
bool isprime(int n)
{
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (int i = 5; i * i <= n; i += 6)
    {
        if ((n % i == 0) || (n % (i + 2) == 0))
            return false;
    }
    return true;
}*/
//ll power(ll x, ll y)
//{
//    ll temp;
//    if(y == 0)
//        return 1;
//    temp = power(x, y / 2);
//    if (y % 2 == 0)
//        return temp * temp;
//    else
//    {
//        if(y > 0)
//            return (x * temp * temp);
//        else
//            return ((temp * temp) / x);
//    }
//}
//#define mod 10000007

//ll pmod(ll a,ll b){ll res=1;a%=mod;assert(b>=0);for(; b; b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
//ll expo(ll x, ll y){ ll res = 1; x = x % mod;  while (y > 0) { if (y & 1)res = (res*x) % mod; y = y>>1;x = (x*x) % mod;}return res;}
//void matmul(ll a[][2], ll b[][2]) { ll tmp[2][2]; for(int i=0; i<2; i++) { for(int j=0; j<2; j++) { tmp[i][j] = 0; for(int k=0; k<2; k++) tmp[i][j] = (tmp[i][j] + a[i][k]*b[k][j]) % mod; }} for(int i=0; i<2; i++) for(int j=0; j<2; j++) a[i][j] = tmp[i][j]; }
//ll fibo(int n)    // returns nth fibonacci number, also S(n) = f(n+2)-1
//{ if(n == 0) return 0; else if(n == 1) return 1; ll T[2][2] = { {0, 1} , {1, 1} }; ll res[2][2] = { {1, 0}, {0,1} }; n--; while(n) { if(n & 1) matmul(res, T); n >>= 1; matmul(T, T); } return res[1][1]; }

#define go(i, a) for (auto i : a)
#define go1(it, v) for(auto it = v.begin(); it != v.end(); ++it)
#define mk(arr,n,type) type *arr=new type[n];
#define sz(obj) (int(obj.size()))
#define ipve(vc,n) vll vc(n); ff1(i,0,n){cin>>vc[i];}
#define ipvc(vc,n) vll vc; ff1(i,0,n){ip(x);vc.pb(x);}
bool sortbysec(const pair<pair<ll,ll>,ll> &a,const pair<pair<ll,ll>,ll> &b)
{
    return (a.second < b.second);
}
bool cmp(pll a,pll b)
{
    return a.ff - a.ss < b.ff - b.ss;
}
bool p2(ll n)
{
   if(n==0)
   return false;

   return (ceil(log2(n)) == floor(log2(n)));
}

const ll N = 2e5+10;
const ll mod=1e9+7;
 //bool ans = all_of(arr, arr + 6, [](int x) {return x & 1; } );
const double pi = 3.141592653589793238460;
/*ll c(ll n,ll m)
{
    ll sm = 1;
    ff1(i,1,m+1)
    {
        sm*=(n-i+1);
        sm/=i;
    }
    return sm;
}*/
//string a="cdefghijklmnopqrstuvwxyz";

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
 ip(n);ip2(a,b);
 cout<<n-a;
 return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
   int n,a,b;
   cin>>n>>a>>b;
   if(n-b>a)cout<<b<<endl;
   else cout<<a<<endl;
	// your code goes here
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n, a, b;
    cin >> n>> a >> b;
    cout << n-a << endl;
    return 0;
}

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef long double ld;
const ll INF = 2e18;
void solve(int tc)
{
	int n,a,b;cin>>n>>a>>b;
	cout<<n-min(a,b)<<"\n";

}
int main()
{
	FAST
	int t=1;//cin>>t;
	for(int i=1;i<=t;i++)
	{
		solve(t);
	}
return 0;
}

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

if(i>a && i>=n-b)
{
    printf("i: %d ",i);
    printf("0\n");
}

}

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    if(n == (a+b))
    {
        int cnt = n-a;
        cnt = max(cnt,b);
        cout<<cnt;
    }
    else
    {
        int cnt = n-a;
        cnt = max(cnt,b+1);
        cout<<cnt;
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
    main(){
    int n , a , b;
    cin >> n >> a >> b;
    cout << n- a;

    }

#include<iostream>
using namespace std;
int main()
{
    int a , b , n;
    cin >> n >> a >> b;
    cout<<n-a<<endl;
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
	int n,a,b,count=0;
	cin>>n>>a>>b;
	for(int i=0;i<n;i++)
	{
		if(i>=a&&n-i<=b)
		count++;
	}
	cout<<count+1;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define max3(a,b,c) max(a,max(b,c))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define min3(a,b,c) min(a,min(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define yes cout<<"YES"<<nl
#define no  cout<<"NO"<<nl
#define nl  '\n'
int main()
{
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int n,a,b;
    cin>>n>>a>>b;
        cout<<n-b;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,n;
	scanf("%d%d%d",&a,&b,&n);
	printf("%d",a-b);
	return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    if(n-a<b)
        cout<<n-a;
    else
        cout<<b+1;
}

#include <iostream>
using namespace std;
 int main()
{
int a,b,n;
cin>>n>>a>>b;
if(b<=n-a)cout<<b+1;
else cout<<n-a;
return 0;
}

//666yuchen
#include<iostream>
#include<cmath>
#include<cstdio>
#include<string>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#define ll long long
using namespace std;
int main()
{
  cout<<2;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pb push_back
#define vb vector<bool>
#define vi vector<int>
#define vll vector<ll>
#define pll pair<ll, ll>
#define MOD 1000000007
#define MAX_TIME 1e9
#define nl "\n"
#define sp " "
#define gcd __gcd
#define pf printf
#define sf scanf
#define se(a) a.begin(), a.end()
#define fill(a,n) for(int i = 0; i < n; i++) cin>>a[i]

int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    cout<<(n-a)<<nl;
}

#include <cstdio>
#include <cmath>
#include <cstdlib>

main (){
     int n,a,b;

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

     return 0;
     }

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>

using namespace std;

int main()
{
	int n, a, b;
	cin >> n >> a >> b;
	int sum = 0;
	sum = n - a;
	cout << sum << endl;
}

#include<iostream>
using namespace std;
int main()
{
    int a , b , n;
    cin >> n >> a >> b;
    if(a==b && (a+b)<n)
    cout<<a+1<<endl;
    else
    cout<<b<<endl;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long n,m,i,j,k,x,y,t=0;
    cin>>n>>x>>y;
    cout<<n-x;
    return 0;
}

#include<stdio.h>
#include <iostream>
#include<conio.h>
#include<string>
#include <ctype.h>

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

#include<iostream>
#include<string>

using namespace std;
int main ()
{
	int n,a,b;
	cin>>n>>a>>b;
	int sum=0;
	for(int i=a+1;i<=n;i++)
	{
		if(i>=b && (i>0))
			sum++;
	}
	cout<<sum<<endl;
	return 0;
}

#include<iostream>
using namespace std;
int main() {
    int a,b,n;
    cin>>n>>a>>b;
    cout<<min(n-a,b++);
    return 0;
}

#include<iostream>
using namespace std;
int main(){
	int n,a,b;
	cin >> n >> a>>b;
	cout << n-a;
}

#include<iostream>
using namespace std;
int main()
{
  int n,a,b,i,count=0;
  cin>>n>>a>>b;
  for(i=a+1;i>n-b;i++)
  count++;
  cout<<count;
  return 0;
}

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

int n,a,b;
while(scanf("%d%d%d",&n,&a,&b)!=EOF){
if(n-a<n-b) printf("%d\n",n-b);
else printf("%d\n",n-a);

}
return 0;
}

#include <iostream>
using namespace std;

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

if(n-a <= b+1) cout<<n-a<<endl;
else cout<<b+1<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main ( )
{

	int n ,a, b;
	cin>>n>>a>>b ;
	int x= min(a, b) ;

   	cout<<x+1<<endl ;

return 0 ;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(a,b)+1<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    printf("%d ",++a);
    return 0;
}

#include<bits/stdc++.h>
#define ll long long int
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl

using namespace std;

int main()
{
   int n,a,b;
   cin>>n>>a>>b;
   cout<<max(n-a,b)<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    if(a==0||b==0)
    {
        if(a==0) cout<<n;
        if(b==0) cout<<"1";
    }
    else
    {
        if(a>b) cout<<n-b+1;
        else cout<<n-a;
    }
}