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.

Input

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

Output

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

Examples

Input

3 1 1


Output

2


Input

5 2 3


Output

3

Note

The 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.
import java.lang.*;
import java.io.*;
import java.util.*;
import java.math.*;
 
public class Main implements Runnable{
	public static int low=0, high=0;
	public static void main(String args[] ) throws Exception {
		new Thread(null, new Main(),"Main",1<<27).start();
	}
	//---------------------------------Actual CODE---------------------------------------//
	public void run() {
		InputReader in = new InputReader(System.in);
	    PrintWriter out = new PrintWriter(System.out); 
//	    int t = in.nextInt();
//        while(t-- > 0)
        {
        	int n=in.nextInt(), a=in.nextInt(), b=in.nextInt(), c=0;
        	if(a+b+1>=n) {
        		for(int i=a;i<=b || i<=n;i++)
        			c++;
        		out.println(c-1);
        	}
        	else {
//        		for(int i=a;i<=b || i<=n;i++)
//        			c++;
        		c=(a+b+1)-a;
        		out.println(c);
        	}
        }
	    out.close();
	}
	//----------------------------------------------------------------------------------//
	public static int subarraysum(int a[], int n) {
		int maxcurr=a[0], max=a[0];
		for(int i=1;i<n;i++) {
			maxcurr=Math.max(a[i], a[i]+maxcurr);
			max=Math.max(maxcurr, max);
		}
		return max;
	}
	public static void mergeSort(int a[], int l, int h) {
		if(l<h) {
			int mid=(l+h)/2;	
			mergeSort(a, l, mid);
			mergeSort(a, mid+1, h);
			merge(a, l, mid, h);
		}
	}
	public static void merge(int a[], int l, int mid, int h) {
		int m1[]=Arrays.copyOfRange(a, l, mid+1 );
		int m2[]=Arrays.copyOfRange(a, mid+1, h+1);
		int i=0,j=0,k=l;
		while(i<m1.length && j<m2.length) {
			if(m1[i]<=m2[j])
				a[k++]=m1[i++];
			else
				a[k++]=m2[j++];
		}
		while(i<m1.length)
			a[k++]=m1[i++];
		while(j<m2.length)
			a[k++]=m2[j++];
	}
	public static void quickSort(int a[], int l, int h) {
		if(l<h) {
			int pivotindx=partition(a,l,h);
		quickSort(a, l, pivotindx-1);	
			quickSort(a, pivotindx+1, h);
		}
	}
	public static int partition(int a[], int l, int h) {
		int pivot=a[h], p_inx=l, temp=0;
		for(int i=l;i<h;i++) {
			if(a[i]<=pivot) {
				temp=a[i];
				a[i]=a[p_inx];
				a[p_inx]=temp;
				p_inx++;
			}
		}
		temp=a[h];
		a[h]=a[p_inx];
		a[p_inx]=temp;
		return p_inx;		
	}
	public static int binarySearch(int a[], int l, int h, int x) {
		while(l<=h) {
			int mid=l+(h-l)/2;
			if(a[mid]==x)
				return mid;
			else if(a[mid]<x)
				l=mid+1;
			else
				h=mid-1;
		}
		return -1;
	}
	public static int gcd(int a, int b) {
		if(b==0)
			return a;
		else
			return gcd(b,a%b);
		
	}
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
       
        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();
           
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }
            
                if(numChars <= 0)              
                    return -1;
            }
            return buf[curChar++];
        }
     
        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();
           
            while(isSpaceChar(c))
                c = read();
           
            int sgn = 1;
           
            if (c == '-') {
                sgn = -1;
                c = read();
            }
           
            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
           
            return res * sgn;
        }
       
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
           
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }
       
        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
       
        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();	
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));
           
            return res.toString();
        }
     
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
     
        public String next() {
            return readString();
        }
       
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}