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.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.*;
import java.math.*;
import java.io.*;
import java.text.*;
public class hacker
{
    

    static float area(int x1, int y1, int x2, 
                        int y2, int x3, int y3)
    {
        return (float)Math.abs((x1 * (y2 - y3) + 
        x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
    }
         
    /* A function to check whether point P(x, y) 
    lies inside the rectangle formed by A(x1, y1), 
    B(x2, y2), C(x3, y3) and D(x4, y4) */
    static boolean check(int x1, int y1, int x2, int y2,
    int x3, int y3, int x4, int y4, int x, int y)
    {
         
        /* Calculate area of rectangle ABCD */
        float A = area(x1, y1, x2, y2, x3, y3)+ 
                area(x1, y1, x4, y4, x3, y3);
     
        /* Calculate area of triangle PAB */
        float A1 = area(x, y, x1, y1, x2, y2);
     
        /* Calculate area of triangle PBC */
        float A2 = area(x, y, x2, y2, x3, y3);
     
        /* Calculate area of triangle PCD */
        float A3 = area(x, y, x3, y3, x4, y4);
     
        /* Calculate area of triangle PAD */
        float A4 = area(x, y, x1, y1, x4, y4);
     
        /* Check if sum of A1, A2, A3 and A4 
        is same as A */
        return (A == A1 + A2 + A3 + A4);
    }
     



     public static int popCount(int n) 
   {
        n -= (n >>> 1) & 0x55555555;
        n = ((n >>> 2) & 0x33333333) + (n & 0x33333333);
        n = ((n >> 4) & 0x0F0F0F0F) + (n & 0x0F0F0F0F);
        return (n * 0x01010101) >> 24;
    }

// Speed up counting by counting the primes per
// array slot and not individually. This yields
// another factor of about 1.24 or so.
    public static int nthPrime(long n) {
        if (n < 2) return 2;
        if (n == 2) return 3;
        if (n == 3) return 5;
        int limit, root, count = 2;
        limit = (int)(n*(Math.log(n) + Math.log(Math.log(n)))) + 3;
        root = (int)Math.sqrt(limit);
        switch(limit%6) {
            case 0:
                limit = 2*(limit/6) - 1;
                break;
            case 5:
                limit = 2*(limit/6) + 1;
                break;
            default:
                limit = 2*(limit/6);
        }
        switch(root%6) {
            case 0:
                root = 2*(root/6) - 1;
                break;
            case 5:
                root = 2*(root/6) + 1;
                break;
            default:
                root = 2*(root/6);
        }
        int dim = (limit+31) >> 5;
        int[] sieve = new int[dim];
        for(int i = 0; i < root; ++i) {
            if ((sieve[i >> 5] & (1 << (i&31))) == 0) 
            {
                int start, s1, s2;
                if ((i & 1) == 1) 
                {
                    start = i*(3*i+8)+4;
                    s1 = 4*i+5;
                    s2 = 2*i+3;
                }
                else
                {
                    start = i*(3*i+10)+7;
                    s1 = 2*i+3;
                    s2 = 4*i+7;
                }
                for(int j = start; j < limit; j += s2) 
                {
                    sieve[j >> 5] |= 1 << (j&31);
                    j += s1;
                    if (j >= limit) break;
                    sieve[j >> 5] |= 1 << (j&31);
                }
            }
        }
        int i;
        for(i = 0; count < n; ++i) 
        {
            count += popCount(~sieve[i]);
        }
        --i;
        int mask = ~sieve[i];
        int p;
        for(p = 31; count >= n; --p) 
        {
            count -= (mask >> p) & 1;
        }
            return 3*(p+(i<<5))+7+(p&1);
        }
    
    static long GCD(long a,long b)
    {
        if(a==0 || b==0)
        {
            return 0;
        }
        if(a==b)
        {
            return a;
        }
        if(a>b)
        {
            return GCD(a-b,b);
        }
        return GCD(a,b-a);
    }

    static long lcm(long a,long b)
    {
        return (a*b)/GCD(a,b);
    }

    static long pow(long a,long b)
    {
        long res = 1;
        while(b>0)
        {
            if((b&1)==1)
            {
                res *= a;
            }

            b >>= 1;
            a *=a;
        }
        return res%(1000000007);
    }

     static int mod(String num, int a) 
    { 
          
        // Initialize result 
        int res = 0; 
  
        // One by one process all digits of 'num' 
        for (int i = 0; i < num.length(); i++) 
            res = (res * 10 + (int)num.charAt(i) 
                                     - '0') % a; 
  
        return res; 
    } 

    static long fact(long n)
    {
        long res = 1;
        for(int i=1;i<=n;i++)
        {
            res = (res*i)%1000000007;
        }
        return res%1000000007;
    }

  
    public static void main(String[] args) throws Exception
    {
       // in = new Scanner(new File("explicit.in"));
        //out = new PrintWriter("explicit.out");
        new hacker().run();
       
    }

   
    static long digits(long n)
    {
        long res =0;
        while(n>0)
        {
            res+=n%10;
            n/=10;
        }
        return res;
    }


   
    void run()
    {
            Scanner sc = new Scanner(System.in);
            long n = sc.nextLong();
            long m = sc.nextLong();
            long p = sc.nextLong();
            System.out.println(Math.min(n-m,p+1));
            





    }

    static long abs(long n)
    {
        return Math.abs(n);
    }
   
    
    


   


    
}

   
