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.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var param = Console.ReadLine().Split(' ');
            int n = int.Parse(param[0]);
            int a = int.Parse(param[1]);
			int b = int.Parse(param[2]);
			n = n - a;
            Console.WriteLine(n - Math.Max(0, n - b - 1));
        }
    }
}

using System;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] count = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int rez = Math.Min(count[0] - count[1], count[2] + 1);
            Console.WriteLine(rez);
        }
    }
}

using System;
class Test{
    public static void Main(String[] args){
        string [] str =  Console.ReadLine().Split();
        int n = Int32.Parse(str[0]);
        int a = Int32.Parse(str[1]);
        int b = Int32.Parse(str[2]);
        int sum1 = n-a;
        int sum2 = n-b;
        if(a+b>=n){
            Console.WriteLine(n-a);
        }else{
            if(n-a>b){
                Console.WriteLine(b+1);
            } else if(n-a == b){
                Console.WriteLine(b);
            } else {
                Console.WriteLine(n-a);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            // the inputs
            List<int> lNums = Console.ReadLine().Split().Select(int.Parse).ToList();
            int n = lNums[0];
            int a = lNums[1];
            int b = lNums[2];

            int lb = a + 1, ub = n;
            if (lb > ub)
            {
                Console.WriteLine("0");
            }
            else
            {
                if (ub - lb > b)
                {
                    lb = n - b;
                }
            }

            Console.WriteLine("{0}", ub - lb + 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace _03_11_11_2_
{
    class Program
    {
        static void Main()
        {
            string st = Console.ReadLine();
            string[] s = Regex.Split(st, " ");
            int n = Int32.Parse(s[0]);
            int a = Int32.Parse(s[1]);
            int b = Int32.Parse(s[2]);
            b = b + 1;
            a = n - a;
            if (b > a) Console.WriteLine("{0}",a);
            else Console.WriteLine("{0}", b);
        }

    }
}

using System;
using System.Collections.Generic;
namespace problem_solve_with_csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] nab = Array.ConvertAll(Console.ReadLine().Split(), e => long.Parse(e));
            long n = nab[0];
            long a = nab[1];
            long b = nab[2];
            Console.Write(n - Math.Max(a + 1, n - b) + 1);
        }
        }
    }

using System;

namespace CSharp
{
    public class _124A
    {
        public static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int n = int.Parse(tokens[0]);
            int a = int.Parse(tokens[1]);
            int b = int.Parse(tokens[2]);

            Console.WriteLine(Math.Min(n - a, b + 1));
        }
    }
}

using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using System.Text;
using System;

class Solution
{
    static int pos(int n, int a,int b)
    {
        int m;
        int c = a + b;
        if (n - c <= 1)
            m = n - a;
        else
            m = b + 1;
        return m;
    }
    static void Main(string[] args)
    {
        int n, a, b;
        string s=Console.ReadLine();
        n = int.Parse(s.Split(' ')[0]);
        b = int.Parse(s.Split(' ')[2]);
        a = int.Parse(s.Split(' ')[1]);
        int res = pos(n,a,b);
        Console.WriteLine(res);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Codeforces
{
    class Program
    {
        static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }
        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }
        static void ReadIntArray(out int[] array, char separator = ' ')
        {
            var input = Console.ReadLine().Split(separator);
            array = new int[input.Length];
            for (int i = 0; i < input.Length; i++)
            {
                array[i] = Int32.Parse(input[i]);
            }

        }
        static int ReadNextInt(string input, int index)
        {
            var ints = input.Split(' ');
            return Int32.Parse(ints[index]);
        }
        static void Main()
        {
            var input = Console.ReadLine();
            var n = ReadNextInt(input, 0);
            var a = ReadNextInt(input, 1);
            var b = ReadNextInt(input, 2);
            var min = Math.Max(a + 1, n - b);
            var res = 0;
            res = Math.Max(n - min + 1, 0);
            Console.WriteLine(res);

        }
   }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, n,cp;

            string[] temp = Console.ReadLine().Split(' ');
            n = Convert.ToInt32(temp[0]);
            a = Convert.ToInt32(temp[1]);
            b = Convert.ToInt32(temp[2]);

            if (a == 0 && b == 0)
            cp=n;
            else
                {
                    if ((a + b) < (n - 1))
                        cp = b + 1;
                    else
                        cp= n - a;
                }
            Console.WriteLine("" + cp);

        }

        }

    }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, n,cp;

            string[] temp = Console.ReadLine().Split(' ');
            n = Convert.ToInt32(temp[0]);
            a = Convert.ToInt32(temp[1]);
            b = Convert.ToInt32(temp[2]);
            cp = cant_lugar(a, b, n);
            Console.WriteLine("" + cp);

        }

        static int cant_lugar(int a, int b, int n)
        {

            if (a == 0 && b == 0)
                return n;
            else if ((a + b) < (n - 1))
                return b + 1;

            else

                return n - a;

            }

        }

    }

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Text;

namespace AcmSolution4
{
    class Program
    {
        private static void Do()
        {
            int n, a, b;
            GetInts(out n, out a, out b);

            int ans = 0;
            for (int x = 1; x <= n; ++x)
            {
                if (x - 1 >= a && n - x <= b)
                    ans++;
            }
            WL(ans);
        }

        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if !ACM_HOME
            //Console.SetIn(new StreamReader("addictive.in"));
            //Console.SetOut(new StreamWriter("addictive.out"));
            Do();
            Console.Out.Close();
#else
            var tmp = Console.In;
            Console.SetIn(new StreamReader("a.txt"));
            while (Console.In.Peek() > 0)
            {
                Do();
                WL("Answer: " + GetStr());
            }
            Console.In.Close();
            Console.SetIn(tmp);
            Console.ReadLine();
#endif
        }

        internal class Item
        {
            public double value;
            public int item;
            public Item(double val, int it)
            {
                value = val;
                item = it;
            }
        }

        #region Utils
        const double Epsilon = 0.00000000000001;

        static string GetStr()
        {
            return Console.ReadLine();
        }

        static string[] GetStrs()
        {
            return GetStr().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        static string[] GetStrs(int cnt)
        {
            var s = new string[cnt];
            for (var i = 0; i < cnt; ++i)
                s[i] = GetStr();
            return s;
        }

        static int GetInt()
        {
            return int.Parse(GetStr());
        }

        static void GetInts(out int a, out int b)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
        }

        static void GetInts(out int a, out int b, out int c)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
            c = q[2];
        }

        static int[] GetInts()
        {
            var s = GetStrs();
            var a = new int[s.Length];
            for (var i = 0; i < s.Length; ++i)
                a[i] = int.Parse(s[i]);
            return a;
        }

        static long GetLong()
        {
            return long.Parse(GetStr());
        }

        static IEnumerable<long> GetLongs()
        {
            return GetStrs().Select(long.Parse);
        }

        static void WriteDouble<T>(T d)
        {
            Console.WriteLine(string.Format("{0:0.000000000}", d).Replace(',', '.'));
        }

        static void WL<T>(T s)
        {
            Console.WriteLine(s);
        }

        static void W<T>(T s)
        {
            Console.Write(s);
        }

        static void Assert(bool b)
        {
            if (!b) throw new Exception();
        }

        static void Swap<T>(ref T a, ref T b)
        {
            var temp = a;
            a = b;
            b = temp;
        }
        #endregion
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
  class Program
  {

    static void Main(string[] args)
    {
      string[] strarr = Console.ReadLine().Split(' ');
      int n = int.Parse(strarr[0]);
      int a = int.Parse(strarr[1]);
      int b = int.Parse(strarr[2]);
      Console.WriteLine(Math.Min(b+1, n - a));

    }
  }
}

using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nab = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToArray();
            int Aux = nab[0] - nab[1];
            Console.WriteLine(Aux <= nab[2] ?Aux: 1+nab[2]);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            int[] m = new int[n];
            for (int i = 0; i < m.Length; i++)
            {
                m[i] = i + 1;
            }
            int count = 0;
            for (int i = 0; i < m.Length; i++)
            {
                int d = i;
                int p = m.Length - i - 1;
                if (d >= a && p <= b)
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
}

using System;
using System.Linq;
using static System.Math;
using static System.Console;

namespace P1 {
    public class A10 {
        static void Main() {
            var a = ReadLine().Split(' ').Select(int.Parse).ToArray();
            Console.WriteLine(Min(a[0] - a[1], a[2] + 1));
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
	public static void Main()
	{
		var x=Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		Console.WriteLine(Math.Min(x[0]-x[1], x[2]+1));
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pustoi
{
    class Program
    {
        static void Main(string[] args)
        {
            string str1 = Console.ReadLine();
            string[] s1 = str1.Split(' ');
            int n = Convert.ToInt32(s1[0]);
            int a = Convert.ToInt32(s1[1]);
            int b = Convert.ToInt32(s1[2]);
            int cnt = 0;
            for(int i = 1; i <= n; i++)
            {
                if(i>a && (n - i)<= b)
                {
                    cnt++;
                }
            }
            Console.WriteLine(cnt);
            Console.Read();
        }
    }
}

using System;
namespace a124 {
    class MainClass {
        public static void Main (string[] args) {
            string[] inp = Console.ReadLine().Split(new char[]{' '});
            UInt32 n = Convert.ToUInt32(inp[0]);
            UInt32 a = Convert.ToUInt32(inp[1]);
            UInt32 b = Convert.ToUInt32(inp[2]);
            UInt32 possible = n-a;
            if (b < possible)
                possible = b+1;
            Console.WriteLine(possible);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TheNumberOfPositions
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] x = Console.ReadLine().Split(' ');
            int n = Int32.Parse(x[0]);
            int a = Int32.Parse(x[1]);
            int b = Int32.Parse(x[2]);
            int count = 0;
            for (int i = a; i <= n - 1; i++)
            {
                if (n - 1 - i <= b)
                    count++;
            }
            Console.WriteLine(count);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n ,a ,b;
            string test = Console.ReadLine();
            string[] splitString = test.Split(' ');
            int[] ints = new int[3];
            for (int i = 0; i < 3; i++)
            {
                int x;
                int.TryParse(splitString[i], out x);
                ints[i] = x;
            }
            n = ints[0];
            a = ints[1];
            b = ints[2];

            /*if ((a < 0)||(a>n) || (b > n) || (n > 100)||(n<0)||(b<0)) return;
            int k = n - a;*/
            int count = 0;
            for (int i = 0; i <= b; i++)
            {
                if (n - i - 1 >= a)
                    count++;
            }
            Console.WriteLine(count);
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] r = Console.ReadLine().Split(' ');
            int n = int.Parse(r[0]);
            int a = int.Parse(r[1]);
            int b = int.Parse(r[2]);
            int minX = Math.Max(a, n - 1 - b);
            int br = n - minX;
            Console.WriteLine(br);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Collections;

namespace Task
{
    class Program
    {
        readonly MyIo io = new MyIo();

        void Solve()
        {
            int n = io.NextInt();
            int a = io.NextInt();
            int b = io.NextInt();

            io.Print(Math.Min(n-a, b + 1));
#if DEBUG
            System.Diagnostics.Debugger.Break();
#endif
        }

        static void Main(string[] args)
        {
            var p = new Program();

            p.Solve();
            p.io.Close();
        }
    }

    #region MyIo
    class MyIo
    {
        readonly char[] separators = new char[] { ' ', '\t' };

#if DEBUG
        readonly TextReader inputStream = new StreamReader("input.txt");
#else
        readonly TextReader inputStream = System.Console.In;
#endif

        readonly TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(separators, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(format, args);
        }

        public void PrintLine(string format, params object[] args)
        {
            outputStream.WriteLine(format, args);
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }
    }

    #endregion
}

/*
 * Сделано в SharpDevelop.
 * Пользователь: admin
 * Дата: 01.02.2013
 * Время: 22:20
 *
 * Для изменения этого шаблона используйте Сервис | Настройка | Кодирование | Правка стандартных заголовков.
 */

using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

using System;
namespace reshenie
{
	class Program
	{
		public static void Main(string[] args)
		{

			string[] s = Console.ReadLine().Split(' ');
			int n = int.Parse(s[0]),a=int.Parse(s[1]),b=int.Parse(s[2]) ;

			Console.WriteLine(Math.Min(n-a,b+1));

			//Console.ReadKey(true);
		}
	}
}

using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {

           // Array.ConvertAll((Console.ReadLine().Split(' ')), (x => int.Parse(x)));
            int[] data = Array.ConvertAll((Console.ReadLine().Split(' ')), (x => int.Parse(x)));
            int n = data[0];
            int a = data[1];
            int b = data[2];

            Console.WriteLine(Math.Min(n-a, b+1));
        }

    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Saba
{
    public class Hello1
    {
        public static void Main()
        {
            int[] input = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToArray();
            int n = input[0];
            int a = input[1];
            int b = input[2];
            int output = n - a;
            Console.WriteLine(min(output, b + 1));
        }

        public static int min(int a, int b) { return (a >= b) ? b : a; }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.Threading;
using System.Collections;
using System.IO;

namespace AcmSolution
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            //Console.SetIn(new StreamReader("gcd.in"));
           // Console.SetOut(new StreamWriter("gcd.out"));
            Do();
            //Console.Out.Close();
            Console.ReadLine();
        }

        private static void Do()
        {
            int n;
            int a;
            int b;
            GetInts(out n, out a, out b);
            int numberStart = n - a;
            int number = 0;
            int difference = 0;
            if (n - (a + b + 1) > 0)
            {
                number = b + 1;
                difference = numberStart - number;
            }
            int answer = numberStart - difference;
            Console.WriteLine(answer);
        }

     #region Utils
        private const double Epsilon = 0.00000001;

        private static string GetStr()
        {
            return Console.ReadLine();
        }

        private static string[] GetStrs()
        {
            return GetStr().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] GetStrs(int cnt)
        {
            var s = new string[cnt];
            for (var i = 0; i < cnt; ++i)
                s[i] = GetStr();
            return s;
        }

        private static int GetInt()
        {
            return int.Parse(GetStr());
        }

        private static void GetInts(out int a, out int b)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
        }

        private static void GetInts(out int a, out int b, out int c)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
            c = q[2];
        }

        private static int[] GetInts()
        {
            var s = GetStrs();
            var a = new int[s.Length];
            for (var i = 0; i < s.Length; ++i)
                a[i] = int.Parse(s[i]);
            return a;
        }

        private static long GetLong()
        {
            return long.Parse(GetStr());
        }

        private static IEnumerable<long> GetLongs()
        {
            return GetStrs().Select(long.Parse);
        }

        private static void WriteDouble<T>(T d)
        {
            Console.WriteLine(string.Format("{0:0.000000000}", d).Replace(',', '.'));
        }

        private static void WL<T>(T s)
        {
            Console.WriteLine(s);
        }

        private static void W<T>(T s)
        {
            Console.Write(s);
        }

        private static void Assert(bool b)
        {
            if (!b) throw new Exception();
        }

        private static void Swap<T>(ref T a, ref T b)
        {
            var temp = a;
            a = b;
            b = temp;
        }

        #endregion
    }
}

using System;

namespace ConsoleApplication3
{
    class Program
    {
        static long Vector(long x1, long y1, long x2, long y2, long x3, long y3)
        {
            long ax = x2 - x1;
            long ay = y2 - y1;
            long bx = x3 - x1;
            long by = y3 - y1;
            return ax * by - ay * bx;
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            if (n - a > b)
            {

                Console.WriteLine(b+1);
            }
            else
            Console.WriteLine(n-a);
        }
    }
}

using System;
using System.Collections.Generic;

namespace _NumPos
{
    class ProgramNumPos
    {
        static void GetParams(string input, out int n, out int a, out int b)
        {
            var splitParams = input.Split();
            n = Convert.ToInt32(splitParams[0]);
            a = Convert.ToInt32(splitParams[1]);
            b = Convert.ToInt32(splitParams[2]);
        }

        static string Run(string input)
        {
            int n, a, b;

            GetParams(input, out n, out a, out b);

            return string.Format("{0}", Math.Min(n - a, b+1));
        }

        static void Main(string[] args)
        {
            var inputs = new List<string>();
            if (args.Length == 0)
            {
                var input = Console.ReadLine();
                inputs.Add(input);
            } else
            {
                var input = string.Empty;
                while (input != "-1")
                {
                    input = Console.ReadLine();
                    if (input != "-1") inputs.Add(input);
                }
            }

            foreach (var test in inputs)
            {
                Console.WriteLine(Run(test));
            }
        }
    }
}

using System;
using System.Text;

namespace Codeforces
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            Solve();
        }

        private static void Solve()
        {
            var nab = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

            if (nab[0] - nab[2] <= nab[1])
                Console.WriteLine(nab[0] - nab[1]);
            else
                Console.WriteLine(nab[2] + 1);
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int n = int.Parse(input[0]);
            int a = int.Parse(input[1]);
            int b = int.Parse(input[2]);
            b++;
            a = n - a;
            Console.Write(Math.Min(a, b));
           // Console.ReadLine();
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {

        static void Main()
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            if (a + b == n)
                Console.WriteLine(b);
            else if (a + b > n)
                Console.WriteLine(n - a);
            else
                Console.WriteLine(b + 1);

        }
    }
}

using System;
class Codeforce
{
     static void Main()
    {
        string []s= Console.ReadLine().Split();

        int n = int.Parse( s[0] );
        int a = int.Parse( s[1]);
         int b = int.Parse(s[2]);
         int nub = 0;

         for (int i = n-1-a ; i>= 0 ; i--)
             if (i<= b)
                  nub++;

         Console.WriteLine( nub) ;

    }
}

// #using System.Collections.Generic;
using System;

namespace A
{
    class MainClass
    {
        public static void Main ()
        {
            string[] test = Console.ReadLine ().Split (' ');
            int n = int.Parse (test [0]), a = int.Parse (test [1]), b = int.Parse (test [2]);
            n = n - a;
            while (n > b+1)
                n --;

            Console.WriteLine (n);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _124A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] line = Array.ConvertAll<string, int>(Console.ReadLine().Split(),k => int.Parse(k));
            int n = line[0], a = line[1], b = line[2], count = 0;
            for(int i = a;i<n;i++)
            {
                if (n - i - 1 <= b)
                    count++;
            }
            Console.WriteLine(count);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = 0;
            int ans = 0;
            string n = Console.ReadLine();
            string[] a = n.Split(' ');
            for (int i = 0; i <= int.Parse(a[0]); i++)
            {
                if (i > int.Parse(a[1]))
                    k++;
            }
            if (k > int.Parse(a[2]))
                ans = int.Parse(a[2]) + 1;
            else ans = k;
            Console.WriteLine(ans);
            Console.ReadLine();
        }
    }
}

using System;
using System.Linq;
using static System.Console;

namespace task
{
    class Program
    {
        static void Main(string[] args)
        {
            var aData = ReadLine().Split(' ').Select(int.Parse);
            var n = aData.ElementAt(0);
            var a = aData.ElementAt(1);
            var b = aData.ElementAt(2);
            var c = 0;
            if (a + b >= n)
            {
                c = Math.Min(n - a, b);
            }
            else
            {
                c = b + 1;
            }
            WriteLine(c);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class A1
    {
        public static void Main(String[] args)
        {
            String[] pole = Console.ReadLine().Split(' ');
            int r = Convert.ToInt32(pole[0]);
            int p = Convert.ToInt32(pole[1]);
            int z = Convert.ToInt32(pole[2]);
            int vysledek = 0;
            if (r - p < z + 1) vysledek = r - p;
            else vysledek = z + 1;
            Console.Write(vysledek.ToString());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace A.Количество_позиций
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            if (a + b > n)
                n = n - a;
            else if (a + b == n)
                n = n - a;

            else
                n = b+1;
            Console.WriteLine(n);
        }
    }
}

using System;
using System.Collections.Generic;
namespace problem_solve_with_csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] nab = Array.ConvertAll(Console.ReadLine().Split(), e => long.Parse(e));
            long n = nab[0];
            long a = nab[1];
            long b = nab[2];
            Console.Write(n - Math.Max(a + 1, n - b) + 1);
        }
        }
    }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _1_The_Number_of_Position
{
    class Program
    {
        static void Main(string[] args)
        {
            //Entrada dos dados
            string value = Console.ReadLine();

            //Divisao da string para os valores de cada area especifica
            int n = int.Parse(value.Split(' ')[0]);
            int a = int.Parse(value.Split(' ')[1]);
            int b = int.Parse(value.Split(' ')[2]);

            Console.WriteLine(Math.Min(n-a,b+1));

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _1_The_Number_of_Position
{
    class Program
    {
        static void Main(string[] args)
        {

            int n;//Numero de pessoas na fila
            int a;//Quantidade minima de pessoas a frente
            int b;//Quantidade maxima de pessoas a tras

            //Entrada dos dados
            string value = Console.ReadLine();

            //Divisao da string para os valores de cada area especifica
            n = int.Parse(value.Split(' ')[0]);
            a = int.Parse(value.Split(' ')[1]);
            b = int.Parse(value.Split(' ')[2]);

            //Metodo Math.Min retorna o menor valor entre 2 numeros
            //n-a: quantidade de pessoas na fila menos a quantidade minima de pessoas a frente
            //b+1 quantidade maxima de pessoas atras + 1
            Console.WriteLine(Math.Min(n - a, b + 1));

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();

			var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			Console.WriteLine(Math.Min(inputs1[0] - inputs1[1], inputs1[2] + 1));
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections;
using System.Text;

namespace Dictionary
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int n = int.Parse(input[0]);
            int a = int.Parse(input[1]);
            int b = int.Parse(input[2]);
            int cur = n - a;

            Console.WriteLine(cur>b?b+1:cur);

        }

    }
    }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NEwTechTEst
{
    class Program
    {

        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(s => int.Parse(s));
            var n = input.ElementAt(0);
            var a = input.ElementAt(1);
            var b = input.ElementAt(2);
            Console.WriteLine(n - a > b ? b+1 : n - a);
        }

    }
}

using System;

namespace _92D2A
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            Console.WriteLine(Math.Min(n - a,b + 1));
            Console.ReadLine();
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            var t = Console.ReadLine();
            var tt = t.Split(' ');
            int n = int.Parse(tt[0]);
            int a = int.Parse(tt[1]);
            int b = int.Parse(tt[2]);

            Console.Write(n - Math.Max(a , n - b - 1));

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleProblem
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');

            int n = int.Parse(s[0].ToString());
            int a = int.Parse(s[1].ToString());
            int b = int.Parse(s[2].ToString());

            int k = a + 1;

            int t = n - b;

            Console.WriteLine(n - (Math.Max(k,t) - 1));

           // Console.ReadLine();

        }
    }
}

/*

 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Diagnostics;

public class Solver
{
    public void Solve()
    {
        Trace.WriteLine("hello world!");
        int n = ReadInt();
        int a = ReadInt();
        int b = ReadInt();
        int m = n - Math.Max(a+1, n-b) + 1;
        Write(m);
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
        // reader = new StreamReader("..\..\input.txt");
        reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\..\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            new Solver().Solve();
            //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch
        {
#if DEBUG
            // Console.WriteLine(ex);
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write
    private static Queue<string> currentLineTokens = new Queue<string>();
    private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }
    public static string ReadToken() { while (currentLineTokens.Count == 0)currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(ReadToken()); }
    public static long ReadLong() { return long.Parse(ReadToken()); }
    public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }
    public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }
    public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }
    public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++)matrix[i] = ReadIntArray(); return matrix; }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++)ret[i][j] = matrix[j][i]; } return ret;
    }
    public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++)lines[i] = reader.ReadLine().Trim(); return lines; }
    public static void WriteArray<T>(IEnumerable<T> array) { writer.WriteLine(string.Join(" ", array)); }
    public static void Write(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array)writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }
    #endregion
}

/*

 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Diagnostics;

public class Solver
{
    public void Solve()
    {
        int n = ReadInt();
        int a = ReadInt();
        int b = ReadInt();
        int m = n - Math.Max(a+1, n-b) + 1;
        Write(m);
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        new Solver().Solve();
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write
    private static Queue<string> currentLineTokens = new Queue<string>();
    private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }
    public static string ReadToken() { while (currentLineTokens.Count == 0)currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(ReadToken()); }
    public static long ReadLong() { return long.Parse(ReadToken()); }
    public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }
    public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }
    public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }
    public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++)matrix[i] = ReadIntArray(); return matrix; }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++)ret[i][j] = matrix[j][i]; } return ret;
    }
    public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++)lines[i] = reader.ReadLine().Trim(); return lines; }
    public static void WriteArray<T>(IEnumerable<T> array) { writer.WriteLine(string.Join(" ", array)); }
    public static void Write(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array)writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }
    #endregion
}

using System;

namespace _4A_watermelon
{
    class Program
    {
        static void Main(string[] args)
        {
            string line= Console.ReadLine();
            string[]tok=line.Split(' ');
            int n=int.Parse(tok[0]),a=int.Parse(tok[1]),b=int.Parse(tok[2]);
                if(n-(a+b)>1)
                    Console.WriteLine("{0}",n-(a+n-(a+b)-1));
                else
                     Console.WriteLine("{0}",n-a);

        }
    }
}

using System;

namespace AllProblems
{
    class Program
    {
        static void Main(string[] args)
        {
            _124A_NoOfPositions.Run();

        }
    }
    class _124A_NoOfPositions
    {
        public static void Run()
        {
            var line = Console.ReadLine().Split(' ');
            var n = byte.Parse(line[0]);
            var a = byte.Parse(line[1]);
            var b = byte.Parse(line[2]);

            var x = n - a;
            var m = x-1 <= b ? x : b + 1;

            Console.WriteLine(m);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] s = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int n = s[0];
            int a = s[1];
            int b = s[2];
            Console.WriteLine(n - Math.Max(a + 1, n - b) + 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CF._124A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] nab = Console.ReadLine().Split();
            int n = int.Parse(nab[0]);
            int a = int.Parse(nab[1]);
            int b = int.Parse(nab[2]);
            int ans = 0;
            if (a + 1 >= n - b)
                ans = n - a;
            else
                ans = b + 1;
            if (ans <= 0)
                Console.WriteLine("0");
            else
                Console.WriteLine(ans.ToString());
        }
    }
}

#region imports
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
#endregion

namespace CodeForces
{
    class Problem
    {
        const bool IsContest = true;

        void Solve()
        {
            var n = _.NextInt();
            var a = _.NextInt();
            var b = _.NextInt();
            var ans = Math.Max(n - Math.Max(a, n - b - 1), 0);
            _.WriteLine(ans);
        }

        int Dist(int s, int t, int[] d)
        {
            var dist = 0;
            for (var cur = s; cur != t; cur = (cur + 1) % d.Length) dist += d[cur];
            return dist;
        }

        #region shit
        private readonly InOut _ = new InOut(IsContest);
        static void Main(string[] args)
        {
            var p = new Problem();
            p.Solve();
            p._.Close();
        }
    }
    class InOut
    {
        private const string InputFile = "input.txt";
        private const string OutputFile = "output.txt";
        public StreamWriter Cout { get; private set; }
        public StreamReader Cin { get; private set; }
        private void SetConsoleIo()
        {
            Cin = new StreamReader(new BufferedStream(Console.OpenStandardInput()));
            Cout = new StreamWriter(new BufferedStream(Console.OpenStandardOutput()));
        }
        private void SetFileIo(string inputFile, string outputFile) { Cin = new StreamReader(inputFile); Cout = new StreamWriter(outputFile); }
        public InOut() { SetConsoleIo(); }
        public InOut(string inputFile, string outputFile) { SetFileIo(inputFile, outputFile); }
        public InOut(bool isContest) { if (isContest) SetConsoleIo(); else SetFileIo(InputFile, OutputFile); }
        public void WriteLine(object x) { Cout.WriteLine(x); }
        public void Close() { Cin.Close(); Cout.Close(); }
        public void WriteLine(string format, params object[] args) { Cout.WriteLine(format, args); }
        private int _pos;
        private string[] _tokens;

        private string[] NextStringArray() { return Cin.ReadLine().Split(" \t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); }
        public string NextToken()
        {
            while (_tokens == null || _pos == _tokens.Length)
            {
                // ReSharper disable once PossibleNullReferenceException
                _tokens = NextStringArray();
                _pos = 0;
            }
            return _tokens[_pos++];
        }
        public int NextInt() { return int.Parse(NextToken()); }
        public long NextLong() { return long.Parse(NextToken()); }
        public double NextDouble() { return double.Parse(NextToken(), CultureInfo.InvariantCulture); }
        public int[] NextIntArray() { return NextStringArray().Select(int.Parse).ToArray(); }
        public long[] NextLongArray() { return NextStringArray().Select(long.Parse).ToArray(); }
        #endregion
    }
}

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;

namespace codeforces
{
	class Program
	{
		public class User
		{
			public int c;

			public int r;
		}

		public class Comparer : IComparer<User>
		{
			public int Compare(User x, User y)
			{
				if (x.c < y.c)
					return -1;
				return 1;
			}
		}

		public static long getGcd(long a, long b)
		{
			if (b == 0)
				return a;
			return getGcd(b, a % b);
		}

		public static void WriteYESNO(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string GetString()
		{
			return Console.ReadLine();
		}

		public static List<int> getList()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static int Min(int x, int y)
		{
			return Math.Min(x, y);
		}

		public static int Max(int x, int y)
		{
			return Math.Max(x, y);
		}

		public static int Abs(int x)
		{
			return Math.Abs(x);
		}

		public static int getInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static bool Equal(int x, int y, int x1, int y1)
		{
			return x == x1 && y == y1;
		}

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/
			var arr = getList();
			Console.WriteLine(arr[0] - Max(arr[1] + 1, arr[0] - arr[2]) + 1);
			/*			input.Close();
			output.Close();*/
		}
	}
}

using System;
using System.Linq;

namespace _124A
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int i = 0, count = 0;
            while (s[0] - (s[1] + i + 1) >=0)
            {
                if (s[0] - (s[1] + i + 1) <= s[2]) count++;
                i++;
            }
            Console.WriteLine(count);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

        var n = int.Parse(input[0]);
        var a = int.Parse(input[1]);
        var b = int.Parse(input[2]);

        Console.WriteLine(Math.Min(n-a, b+1));

    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace MakeCalendar
{
    class MainClass
    {

        static int ReadIntLine()
        {
            return int.Parse(Console.ReadLine());
        }

        static void ReadInt(ref int a)
        {
            a = ReadIntArrayLine()[0];
        }

        static void ReadInts(ref int a, ref int b)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1];
        }

        static void ReadInts(ref int a, ref int b, ref int c)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3];
        }

        static int[] ReadIntArrayLine()
        {
            char[] sep = { ' ' };
            return Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        static void PrintLn(object obj)
        {
            Console.WriteLine(obj.ToString());
        }

        public static string Reverse(string s)
        {
            char[] charArray = s.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }

//----------------------------------------------------------------------------

        static void Main(string[] args)
        {

            int n = 0, a = 0, b = 0;
            ReadInts(ref n, ref a, ref b);

            PrintLn(Math.Max(0,Math.Min(b+1,n-a)));

        }

    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace CP_CS
{

    class Task
    {

        static void Solve()
        {
            int n = ReadInt();
            int a = ReadInt();
            int b = ReadInt();
            Write(Math.Min(n-a, b+1));
        }

        public static double Rast(int[] xy1, int[] xy2)
        {
            return Math.Sqrt(Math.Pow(xy1[0] - xy2[0], 2) + Math.Pow(xy1[1] - xy2[1], 2));
        }

        static string[] Split(string str, int chunkSize)
        {
            return Enumerable.Range(0, str.Length / chunkSize)
                .Select(i => str.Substring(i * chunkSize, chunkSize)).ToArray();
        }

        #region -- Main --

        private static TextReader reader;
        private static TextWriter writer;

        static void Main()
        {
#if DEBUG
            //reader = new StreamReader("..\\..\\input.txt");
            reader = new StreamReader(Console.OpenStandardInput());
            writer = Console.Out;
            //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("pluses.in");
        //writer = new StreamWriter("pluses.out");
#endif
            try
            {
                //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
                //thread.Start();
                //thread.Join();
                Solve();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
            }
            reader.Close();
            writer.Close();
        }

        #endregion
        #region -- Read / Write --

        private static Queue<string> currentLineTokens = new Queue<string>();

        private static string[] ReadAndSplitLine()
        {
            return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadAndSplitLine(char divisor)
        {
            return reader.ReadLine().Split(new[] { divisor }, StringSplitOptions.RemoveEmptyEntries);
        }

        public static string ReadToken()
        {
            while (currentLineTokens.Count == 0) currentLineTokens = new Queue<string>(ReadAndSplitLine());
            return currentLineTokens.Dequeue();
        }

        public static int ReadInt()
        {
            return int.Parse(ReadToken());
        }

        public static long ReadLong()
        {
            return long.Parse(ReadToken());
        }

        //public static BigInteger ReadBigInteger()
        //{
        //    return BigInteger.Parse(ReadToken());
        //}

        public static double ReadDouble()
        {
            return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
        }

        public static int[] ReadIntArray()
        {
            return ReadAndSplitLine().Select(int.Parse).ToArray();
        }

        public static bool[] ReadBoolArray()
        {
            return ReadAndSplitLine().ToString().ToCharArray().Select(chr => chr == '1').ToArray();
        }

        public static long[] ReadLongArray()
        {
            return ReadAndSplitLine().Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
        }

        public static int[][] ReadIntMatrix(int numberOfRows)
        {
            int[][] matrix = new int[numberOfRows][];
            for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray();
            return matrix;
        }

        public static bool[][] ReadBoolMatrix(int numberOfRows)
        {
            bool[][] matrix = new bool[numberOfRows][];
            for (int i = 0; i < numberOfRows; i++)
                matrix[i] = ReadBoolArray();
            return matrix;
        }

        public static bool[][] TransposeBoolMatrix(bool[][] array, int numberOfRows)
        {
            bool[][] matrix = array;
            bool[][] ret = new bool[matrix[0].Length][];
            for (int i = 0; i < ret.Length; i++)
            {
                ret[i] = new bool[numberOfRows];
                for (int j = 0; j < numberOfRows; j++) ret[i][j] = matrix[j][i];
            }
            return ret;
        }

        public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
        {
            int[][] matrix = ReadIntMatrix(numberOfRows);
            int[][] ret = new int[matrix[0].Length][];
            for (int i = 0; i < ret.Length; i++)
            {
                ret[i] = new int[numberOfRows];
                for (int j = 0; j < numberOfRows; j++) ret[i][j] = matrix[j][i];
            }
            return ret;
        }

        public static string[] ReadLines(int quantity)
        {
            string[] lines = new string[quantity];
            for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim();
            return lines;
        }

        public static void WriteArray<T>(IEnumerable<T> array)
        {
            writer.WriteLine(string.Join(" ", array));
        }

        public static void Write(params object[] array)
        {
            WriteArray(array);
        }
        public static void WriteLines<T>(IEnumerable<T> array)
        {
            foreach (var a in array) writer.WriteLine(a);
        }
        private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
        {
            public new TValue this[TKey key]
            {
                get { return ContainsKey(key) ? base[key] : default(TValue); }
                set { base[key] = value; }
            }
        }
        private static T[] Init<T>(int size) where T : new()
        {
            var ret = new T[size];
            for (int i = 0; i < size; i++) ret[i] = new T();
            return ret;
        }
        #endregion
    }
}

using System;
class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(new char[] { '\t', ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int answer = (int.Parse(input[2]) + 1) < (int.Parse(input[0]) - int.Parse(input[1])) ? (int.Parse(input[2]) + 1) : (int.Parse(input[0]) - int.Parse(input[1]));
            Console.WriteLine(answer);
        }
    }

using System;
using System.Linq;
class My
{
    static void Main()
    {
        var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

        Console.Write(s[0] - Math.Max(s[0] - (s[2] + 1), s[1]));
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int p = nums[0];
            int bef = nums[1];
            int aft = nums[2];

            int ans = (bef + aft) >= p ? p - bef : aft + 1;
            Console.WriteLine(ans);
            Console.ReadLine();
        }
    }
}

using System;

class A124 {
    public static void Main() {
        var line = Console.ReadLine().Split();
        var n = int.Parse(line[0]);
        var a = int.Parse(line[1]);
        var b = int.Parse(line[2]);
        Console.WriteLine(Math.Min(n - a, b + 1));
    }
}

using System;
using System.Linq;

namespace Test
{
    class Program
    {
        static void Main()
        {
            byte[] arrInput = Console.ReadLine().Split(' ').Select(x => Convert.ToByte(x)).ToArray();
            Console.WriteLine((arrInput[0] - arrInput[1] - 1) >  arrInput[2] ? (arrInput[2] + 1) : (arrInput[0] - arrInput[1]));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication6
{
    class Program
    {

        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int n, a, b;
            n = input[0]; a = input[1]; b = input[2];
            n -= a; b += 1;
            Console.WriteLine(Math.Min(n, b));
            //int n = input[0], t = input[1];
            //string q = Console.ReadLine();
            //char[] s = q.ToArray();
            //for(int i = 0; i < t; i++)
            //{
            //    for (int j = 0; j< n; j++)
            //    {
            //        if (s[j] == 'B' && s[j + 1] == 'G')
            //        {
            //            s[j] = 'G';
            //            s[j + 1] = 'B';
            //            j++;
            //        }
            //    }
            //}
            //Console.WriteLine(s);
            ////int re = 0;
            //var mini = 0;
            //for (int i = 0; i < 5; i++)
            //{
            //    var n = Console.ReadLine().Split(' ').ToList();
            //    var m = n.IndexOf("1");
            //    if (m != -1)
            //        mini = Math.Abs(2 - i) + Math.Abs(2 - m);
            //}
            //Console.WriteLine(mini);

            //    int re, x = 0, y = 0, z = 0;
            //    re = Convert.ToInt32(Console.ReadLine());
            //    while(re > 0)
            //    {
            //        int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //        x += n[0]; y += n[1]; z += n[2];
            //        re--;
            //    }
            //    if (x == 0 && y == 0 && z == 0)
            //        Console.WriteLine("YES");
            //    else
            //        Console.WriteLine("NO");
               //Console.ReadKey();

        }
    }
}

using System;
class Demo
{
    static void Main()
    {
        var v = Console.ReadLine().Split();
        int n = int.Parse(v[0]);
        int a = int.Parse(v[1]);
        int b = int.Parse(v[2]);
        Console.WriteLine(n - Math.Max(a + 1, n - b) + 1);
    }
}

using System;
using System.Linq;

class Program{
  static void Main() {
    var s  = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    Console.WriteLine(s[0] + 1 - Math.Max(1+s[1], s[0]-s[2]));
  }
}

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A.The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            if(a+b>=n)
             {
            Console.WriteLine(n - a);
             }
             else
            {
             Console.WriteLine(b+1);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeForces_124A_The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int op = 0;
            if (a[0]>a[1]+a[2])
            {
                op = a[2] + 1;
            }
            else
            {
                op = a[0] - a[1];
            }
            Console.WriteLine(op);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            long n = Int64.Parse(input[0]);
            long a = Int64.Parse(input[1]);
            long b = Int64.Parse(input[2]);

            long output = n - Math.Max(a + 1, n - b) + 1;
            Console.WriteLine(output.ToString());
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace MTests
{
    static class Program {

        internal static void MyMain()
        {

            var ints = RInts();
            var result = Math.Min(ints[0] - ints[1],ints[2]+1);
            WLine(result);

        }

        static void Main(string[] args)
        {

#if !HOME
            MyMain();
#else
            Secret.MyMain();
#endif
        }

        #region Utils
        static string RLine()
        {
            return Console.ReadLine();
        }

        static string[] RLine(string separator = " ")
        {
            return Console.ReadLine().Split(new string[] { separator }, StringSplitOptions.None);
        }

        static int RInt()
        {
            var str = Console.ReadLine();
            return Convert.ToInt32(str);
        }

        static int[] RInts()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt32(s));
        }
        static void RInts(out int a, out int b)
        {
            var ints = RInts();
            a = ints[0];
            b = ints[1];
        }

        public static void WLine<T>(IEnumerable<T> list) {
            if (list is string)
            {
                Console.WriteLine(list);
            }
            else {
                Console.WriteLine(string.Join(" ", list));
            }

        }

        public static void WLine(params object[] s)
        {
            Console.WriteLine(string.Join(" ",s));
        }

        public static void WLine(object s)
        {
            Console.WriteLine(s);
        }
        #endregion

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Positions
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);

            int count = 0;
            for (int i=0;i<=b;i++)
            {
                if (n - i - 1 >= a) count++; else break;
            }

            Console.Write(count);

        }
    }
}

using System;
using System.IO;
using System.Text;

namespace The_number_of_positions
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();
            int a = Next() + 1;
            int b = Next();
            int pos = Math.Max(a, n - b);

            writer.WriteLine(n - pos + 1);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            Console.WriteLine(n-Math.Max(a+1,n-b)+1);
            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;
using System.Numerics;
using System.Globalization;
using System.Threading;

namespace probleme {
    class Program {
        static void Main(string[] args) {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]), a = int.Parse(s[1]), b = int.Parse(s[2]);
            int max = Math.Max(a + 1, n - b);
            Console.WriteLine(n - max + 1);
            // Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;

namespace CodeForces.PRACTICE
{
    // The number of positions (math)
    class _124A
    {
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int n = int.Parse(ss[0]);
            int a = int.Parse(ss[1]);
            int b = int.Parse(ss[2]);
            Console.WriteLine(Math.Min(n - a, b + 1));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DominoPiling
{
    public class NumberOfPosition
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine();
            int total = int.Parse(input.Split(' ')[0]);
            int noLessThan = int.Parse(input.Split(' ')[1]);
            int noMoreThan = int.Parse(input.Split(' ')[2]);

            int possibility = 0;

            foreach(var i in Enumerable.Range(noLessThan,total-noLessThan+1))
            {
                if (i - noLessThan > 0 && total - i <= noMoreThan)
                    possibility++;
            }

            Console.WriteLine(possibility);
            Console.ReadLine();

        }
    }
}

using System;
using System.IO;

namespace Issue_124A
{
    public static class Program
    {
        public static void Main(string[] args) {
            var count = IO.Read();
            var before = IO.Read();
            var after = IO.Read();

            var free = count - before;
            var positions = (free <= after)
                ? free
                : after + 1;

            Console.WriteLine(positions);
        }
    }

    public static class IO {
        public const int ZeroCode = (int) '0';

        static IO() {
            Reader = new StreamReader(
                Console.OpenStandardInput(),
                System.Text.Encoding.ASCII,
                false,
                sizeof(int),
                false);
        }

        public static StreamReader Reader {
            get; set;
        }

        public static string ReadLine() {
            return Reader.ReadLine();
        }

        public static int Read() {
            var reader = Reader;
            var symbol = reader.Read();

            while (symbol == ' ') {
                symbol = reader.Read();
            }

            var isNegative = false;
            if (symbol == '-') {
                isNegative = true;
                symbol = reader.Read();
            }

            int result = 0;
            for ( ;
                (symbol != -1) && (symbol != ' ');
                symbol = reader.Read()
            ) {
                var digit = symbol - ZeroCode;

                if (digit < 10 && digit >= 0) {
                    result = (result << 1) + ((result << 1) << 2) + digit;
                } else {
                    if (symbol == 13)         // if symbol == \n
                        reader.Read();        // skip next \r symbol
                    break;
                }
            }

            return isNegative ? ~result + 1 : result;
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] data = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(data[0]);
            int a = Convert.ToInt32(data[1]);
            int b = Convert.ToInt32(data[2]);

            Console.WriteLine(a + 1 > n - b ? n - a : n - (n - b) + 1);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            var q = Console.ReadLine().Split().Select(int.Parse).ToArray();

            if (q[0] - q[1] < q[2])
                Console.WriteLine(q[0] - q[1]);
            else
                if (q[2] + 1 < q[0] - q[1])
                    Console.WriteLine(q[2] + 1);
                else
                    Console.WriteLine(q[0] - q[1]);

            Console.ReadLine();
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;

public class App1
{
    public static void Main()
    {
        Func<string> read = ()=>Console.ReadLine();
        Action<object> write = _=>Console.WriteLine(_.ToString());

        var t=read().ToIntA();
        int n=t[0],a=t[1],b=t[2];

        var x=n-a;
        write((x<=b+1)?x:b+1);
    }
}

static class Exts
{
    public static int ToInt(this string s)
    {
        return int.Parse(s);
    }

    public static int[] ToIntA(this string s)
    {
        return SplitBySpace(s).Select(ToInt).ToArray();
    }

    public static string[] SplitBySpace(this string s)
    {
        return s.Split(new[]{" "},StringSplitOptions.RemoveEmptyEntries);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace broze
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
            if (n[2]+n[1]>=n[0])
            {
                Console.WriteLine(n[0]-n[1]);
            }
            else
            {
                Console.WriteLine(n[2]+1);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;

namespace prA {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif
        static void Main(string[] args) {
            int n = Next();
            int a = Next();
            int b = Next();
            int ans = Math.Min(n - a, b + 1);
            writer.Write(ans);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split();
            int n = int.Parse(input[0]);
            int a = int.Parse(input[1]);
            int b = int.Parse(input[2]);

            int posCount = n - a;

            Console.WriteLine(b < posCount - 1 ? b + 1 : posCount);
            Console.Read();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
   class Program
   {
      static void Main()
      {
         string[] line = Console.ReadLine().Split(' ');
         int n = int.Parse(line[0]);
         int a = int.Parse(line[1]);
         int b = int.Parse(line[2]);
         Console.WriteLine(Math.Min(n - a, b + 1));
      }
   }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication252
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            int start = n - a;
            if (b > start - 1)
            {
                Console.WriteLine(start);
            }
            else
            {
                Console.WriteLine(start - ((start - 1) - b)); ;
            }

        }
    }
}

using System;
using System.Linq;

namespace tren
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] mass = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int count = 0;
            for(int i = mass[1]; i < mass[0]; i++)
            {
                if (mass[0] - 1 - i <= mass[2] ) count++;
            }
            Console.Write(count);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;

namespace Problem124A {
    class Program {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split(' ');
            int peopleInLine = Convert.ToInt32(input[0]);
            int inFront = Convert.ToInt32(input[1]);
            int behind = Convert.ToInt32(input[2]);

            int positions = 0;
            for (int i = inFront+1; i <= peopleInLine; i++) {
                int position = i;
                if (peopleInLine - position <= behind) {
                    positions++;
                }
            }

            Console.WriteLine(positions);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    public class Program
    {
        public static void Main()
        {
            int[] parameters;
            int spots;

            parameters = (Console.ReadLine().Split(' ')).Select(n => Convert.ToInt32(n)).ToArray();

            spots = parameters[0] - parameters[1];

            if (spots > parameters[2])
                Console.WriteLine(parameters[2] + 1);
            else
                Console.WriteLine(spots);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string[] arr1 = a.Split(' ');
            int sub = int.Parse(arr1[0]) - int.Parse(arr1[1]);
            while (sub > (int.Parse(arr1[2])) + 1) sub--;
            Console.Write(sub);
        }
    }
}

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

namespace WarmingUpC_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inputs = Array.ConvertAll<string, int>(Console.ReadLine().Split(' '), int.Parse);
            int n = inputs[0], a = inputs[1], b = inputs[2];
            Console.WriteLine(n - Math.Max(a + 1, n - b) + 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
public class Solver
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        var n = ReadInt();
        var a = ReadInt();
        var b = ReadInt();
        var c = 0;
        if (a + b >= n)
        {
            c = Math.Min(n - a, b);
        }
        else
        {
            c = b + 1;
        }
        writer.WriteLine(c);
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }

    #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var param = Console.ReadLine().Split(' ');
            int n = int.Parse(param[0]);
            int a = int.Parse(param[0]);
            Console.WriteLine(n - a);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var param = Console.ReadLine().Split(' ');
            int n = int.Parse(param[0]);
            int a = int.Parse(param[1]);
			int b = int.Parse(param[2]);
			n = n - a;
            Console.WriteLine(n - Math.Max(0, n - b + 1));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var param = Console.ReadLine().Split(' ');
            int n = int.Parse(param[0]);
            int a = int.Parse(param[1]);
            Console.WriteLine(n - a);
        }
    }
}

using System;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] count = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int rez = count[0] - count[1];

            Console.WriteLine(rez);
        }
    }
}

using System;
class Test{
    public static void Main(String[] args){
        string [] str =  Console.ReadLine().Split();
        int n = Int32.Parse(str[0]);
        int a = Int32.Parse(str[1]);
        int b = Int32.Parse(str[2]);
        Console.WriteLine(n-a);
    }
}

using System;
class Test{
    public static void Main(String[] args){
        string [] str =  Console.ReadLine().Split();
        int n = Int32.Parse(str[0]);
        int a = Int32.Parse(str[1]);
        int b = Int32.Parse(str[2]);
        int sum1 = n-a;
        int sum2 = n-b;
        if(sum1 > sum2){
            Console.WriteLine(sum2);
        } else {
            Console.WriteLine(sum1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, n,cp;

            string[] temp = Console.ReadLine().Split(' ');
            n = Convert.ToInt32(temp[0]);
            a = Convert.ToInt32(temp[1]);
            b = Convert.ToInt32(temp[2]);

            if (a == 0)
                cp = b;
            else if ((a + b) < (n - 1))
                cp = b + 1;
            else
                cp = n - a;
            Console.WriteLine("" + cp);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, n,cp;

            string[] temp = Console.ReadLine().Split(' ');
            n = Convert.ToInt32(temp[0]);
            a = Convert.ToInt32(temp[1]);
            b = Convert.ToInt32(temp[2]);

            if (a == 0)
                cp = b;
            else
            {
                if ((a + b) < (n - 1))
                cp = b + 1;
                else
                cp = n - a;
            }
            Console.WriteLine("" + cp);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, n,cp;

            string[] temp = Console.ReadLine().Split(' ');
            n = Convert.ToInt32(temp[0]);
            a = Convert.ToInt32(temp[1]);
            b = Convert.ToInt32(temp[2]);
            cp = cant_lugar(a, b, n);
            Console.WriteLine("" + cp);

        }

        static int cant_lugar(int a, int b, int n)
        {

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

                else

                    return n - a;
            }

        }

    }

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;

namespace AcmSolution4
{
    class Program
    {
        private static void Do()
        {
            int n, a, b;
            GetInts(out n, out a, out b);

            int ans = 0;
            for (int x = 1; x <= n; ++x)
            {
                if (x - 1 >= a && n - x - 1 <= b)
                    ans++;
            }
            WL(ans);
        }

        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if !ACM_HOME
            //Console.SetIn(new StreamReader("input.txt"));
            //Console.SetOut(new StreamWriter("output.txt"));
            Do();
            //Console.Out.Close();
#else
            var tmp = Console.In;
            Console.SetIn(new StreamReader("a.txt"));
            while (Console.In.Peek() > 0)
            {
                Do();
                WL("Answer: " + GetStr());
            }
            Console.In.Close();
            Console.SetIn(tmp);
            Console.ReadLine();
#endif
        }

        #region Utils
        const double Epsilon = 0.00000000000001;

        static string GetStr()
        {
            return Console.ReadLine();
        }

        static string[] GetStrs()
        {
            return GetStr().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        static string[] GetStrs(int cnt)
        {
            var s = new string[cnt];
            for (var i = 0; i < cnt; ++i)
                s[i] = GetStr();
            return s;
        }

        static int GetInt()
        {
            return int.Parse(GetStr());
        }

        static void GetInts(out int a, out int b)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
        }

        static void GetInts(out int a, out int b, out int c)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
            c = q[2];
        }

        static int[] GetInts()
        {
            var s = GetStrs();
            var a = new int[s.Length];
            for (var i = 0; i < s.Length; ++i)
                a[i] = int.Parse(s[i]);
            return a;
        }

        static long GetLong()
        {
            return long.Parse(GetStr());
        }

        static IEnumerable<long> GetLongs()
        {
            return GetStrs().Select(long.Parse);
        }

        static void WriteDouble<T>(T d)
        {
            Console.WriteLine(string.Format("{0:0.000000000}", d).Replace(',', '.'));
        }

        static void WL<T>(T s)
        {
            Console.WriteLine(s);
        }

        static void W<T>(T s)
        {
            Console.Write(s);
        }

        static void Assert(bool b)
        {
            if (!b) throw new Exception();
        }

        static void Swap<T>(ref T a, ref T b)
        {
            var temp = a;
            a = b;
            b = temp;
        }
        #endregion
    }

    internal class Four
    {
        public int x1;
        public int x2;
        public int y1;
        public int y2;
        public Four(int[] a)
        {
            x1 = Math.Min(a[0], a[2]);
            y1 = Math.Min(a[1], a[3]);
            x2 = Math.Max(a[0], a[2]);
            y2 = Math.Max(a[1], a[3]);
        }

        public bool IsVertical()
        {
            return x1 == x2;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Text;

namespace AcmSolution4
{
    class Program
    {
        private static void Do()
        {
            int n, a, b;
            GetInts(out n, out a, out b);

            int ans = 0;
            for (int x = 0; x < n; ++x)
            {
                if (x - 1 >= a && n - x - 1 <= b)
                    ans++;
            }
            WL(ans);
        }

        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if !ACM_HOME
            //Console.SetIn(new StreamReader("addictive.in"));
            //Console.SetOut(new StreamWriter("addictive.out"));
            Do();
            Console.Out.Close();
#else
            var tmp = Console.In;
            Console.SetIn(new StreamReader("a.txt"));
            while (Console.In.Peek() > 0)
            {
                Do();
                WL("Answer: " + GetStr());
            }
            Console.In.Close();
            Console.SetIn(tmp);
            Console.ReadLine();
#endif
        }

        internal class Item
        {
            public double value;
            public int item;
            public Item(double val, int it)
            {
                value = val;
                item = it;
            }
        }

        #region Utils
        const double Epsilon = 0.00000000000001;

        static string GetStr()
        {
            return Console.ReadLine();
        }

        static string[] GetStrs()
        {
            return GetStr().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        static string[] GetStrs(int cnt)
        {
            var s = new string[cnt];
            for (var i = 0; i < cnt; ++i)
                s[i] = GetStr();
            return s;
        }

        static int GetInt()
        {
            return int.Parse(GetStr());
        }

        static void GetInts(out int a, out int b)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
        }

        static void GetInts(out int a, out int b, out int c)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
            c = q[2];
        }

        static int[] GetInts()
        {
            var s = GetStrs();
            var a = new int[s.Length];
            for (var i = 0; i < s.Length; ++i)
                a[i] = int.Parse(s[i]);
            return a;
        }

        static long GetLong()
        {
            return long.Parse(GetStr());
        }

        static IEnumerable<long> GetLongs()
        {
            return GetStrs().Select(long.Parse);
        }

        static void WriteDouble<T>(T d)
        {
            Console.WriteLine(string.Format("{0:0.000000000}", d).Replace(',', '.'));
        }

        static void WL<T>(T s)
        {
            Console.WriteLine(s);
        }

        static void W<T>(T s)
        {
            Console.Write(s);
        }

        static void Assert(bool b)
        {
            if (!b) throw new Exception();
        }

        static void Swap<T>(ref T a, ref T b)
        {
            var temp = a;
            a = b;
            b = temp;
        }
        #endregion
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
  class Program
  {

    static void Main(string[] args)
    {
      string[] strarr = Console.ReadLine().Split(' ');
      int n = int.Parse(strarr[0]);
      int a = int.Parse(strarr[1]);
      int b = int.Parse(strarr[2]);
      Console.WriteLine(Math.Max(b, n - a));

    }
  }
}

using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
	public static void Main()
	{
		var x=Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		Console.WriteLine(x[0]-x[1]);
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pustoi
{
    class Program
    {
        static void Main(string[] args)
        {
            string str1 = Console.ReadLine();
            string[] s1 = str1.Split(' ');
            int n = Convert.ToInt32(s1[0]);
            int a = Convert.ToInt32(s1[1]);
            int b = Convert.ToInt32(s1[2]);
            for(int i = 1; i <= n; i++)
            {
                if(i>a && (n - i) <= b)
                {
                    Console.WriteLine(i);
                    break;
                }
            }
            Console.Read();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n ,a ,b;
            string test = Console.ReadLine();
            string[] splitString = test.Split(' ');
            int[] ints = new int[3];
            for (int i = 0; i < 3; i++)
            {
                int x;
                int.TryParse(splitString[i], out x);
                ints[i] = x;
            }
            n = ints[0];
            a = ints[1];
            b = ints[2];

            if ((a < 0)||(a>n) || (b > n) || (n > 100)||(n<0)||(b<0)) return;
            int k = n - a;
            Console.WriteLine(k);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n ,a ,b;
            string test = Console.ReadLine();
            string[] splitString = test.Split(' ');
            int[] ints = new int[3];
            for (int i = 0; i < 3; i++)
            {
                int x;
                int.TryParse(splitString[i], out x);
                ints[i] = x;
            }
            n = ints[0];
            a = ints[1];
            b = ints[2];

            if ((a < 0) || (b > n) || (n > 100)||(n<0)||(b<0)) return;
            int k = n - a;
            Console.WriteLine(k);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n ,a ,b;
            string test = Console.ReadLine();
            string[] splitString = test.Split(' ');
            int[] ints = new int[3];
            for (int i = 0; i < 3; i++)
            {
                int x;
                int.TryParse(splitString[i], out x);
                ints[i] = x;
            }
            n = ints[0];
            a = ints[1];
            b = ints[2];

            if ((a < 0)||(a > n) || (b > n) || (n > 100)||(n<0)||(b<0)) return;
            int k = n - a;
            Console.WriteLine(k);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n,a, b;
            string test = Console.ReadLine();
            string[] splitString = test.Split(' ');
            int[] ints = new int[3];
            for (int i = 0; i < 3; i++)
            {
                int x;
                int.TryParse(splitString[i], out x);
                ints[i] = x;
            }

            n = ints[0];
            a = ints[1];
            b = ints[2];
            if ((a <= 0) || (b > n) || (n <= 100)) return;
            Console.WriteLine(n-a);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n,a, b;
            string test = Console.ReadLine();
            string[] splitString = test.Split(' ');
            int[] ints = new int[3];
            for (int i = 0; i < 3; i++)
            {
                int x;
                int.TryParse(splitString[i], out x);
                ints[i] = x;
            }

            n = ints[0];
            a = ints[1];
            b = ints[2];
            Console.WriteLine(n-a);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n,a, b;
            string test = Console.ReadLine();
            string[] splitString = test.Split(' ');
            int[] ints = new int[3];
            for (int i = 0; i < 3; i++)
            {
                int x;
                int.TryParse(splitString[i], out x);
                ints[i] = x;
            }

            n = ints[0];
            a = ints[1];
            b = ints[2];
            if ((a <= 0) || (b > n) || (n >= 100)) return;
            Console.WriteLine(n-a);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n ,a ,b;
            string test = Console.ReadLine();
            string[] splitString = test.Split(' ');
            int[] ints = new int[3];
            for (int i = 0; i < 3; i++)
            {
                int x;
                int.TryParse(splitString[i], out x);
                ints[i] = x;
            }

            n = ints[0];
            a = ints[1];
            b = ints[2];
            if ((a < 0) || (b > n) || (n > 100)) return;
            Console.WriteLine(n-a);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Collections;

namespace Task
{
    class Program
    {
        readonly MyIo io = new MyIo();

        void Solve()
        {
            double d = log2sqrt(3475.0, 1000);

            d = Math.Log(3475.0, 2.0);
        }

        private double log2sqrt(double d, int i)
        {
            if (i < 1)
                return 0;

            double res = 1;
            while (Math.Sqrt(d) > 2)
            {
                d = Math.Sqrt(d);
                res = res * 2.0;
            }

            return res + log2sqrt(d * 100.0, i - 1) / 10.0;
        }

        static void Main(string[] args)
        {
            var p = new Program();

            p.Solve();
#if DEBUG
            System.Diagnostics.Debugger.Break();
#endif
            p.io.Close();
        }
    }

    #region MyIo
    class MyIo
    {
        readonly char[] separators = new char[] { ' ', '\t' };

#if DEBUG
        readonly TextReader inputStream = new StreamReader("input.txt");
#else
        readonly TextReader inputStream = System.Console.In;
#endif

        readonly TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(separators, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(format, args);
        }

        public void PrintLine(string format, params object[] args)
        {
            outputStream.WriteLine(format, args);
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }
    }

    #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.Threading;
using System.Collections;
using System.IO;

namespace AcmSolution
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            //Console.SetIn(new StreamReader("gcd.in"));
           // Console.SetOut(new StreamWriter("gcd.out"));
            Do();
            //Console.Out.Close();
            Console.ReadLine();
        }

        private static void Do()
        {
            int n;
            int a;
            int b;
            GetInts(out n, out a, out b);
            int k = n - a;
            int s = 0;
            if (n - (a + b + 1) > 0)
            {
                s = b + 1;
            }
            int answer = k - s;
            Console.WriteLine(answer);
        }

     #region Utils
        private const double Epsilon = 0.00000001;

        private static string GetStr()
        {
            return Console.ReadLine();
        }

        private static string[] GetStrs()
        {
            return GetStr().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] GetStrs(int cnt)
        {
            var s = new string[cnt];
            for (var i = 0; i < cnt; ++i)
                s[i] = GetStr();
            return s;
        }

        private static int GetInt()
        {
            return int.Parse(GetStr());
        }

        private static void GetInts(out int a, out int b)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
        }

        private static void GetInts(out int a, out int b, out int c)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
            c = q[2];
        }

        private static int[] GetInts()
        {
            var s = GetStrs();
            var a = new int[s.Length];
            for (var i = 0; i < s.Length; ++i)
                a[i] = int.Parse(s[i]);
            return a;
        }

        private static long GetLong()
        {
            return long.Parse(GetStr());
        }

        private static IEnumerable<long> GetLongs()
        {
            return GetStrs().Select(long.Parse);
        }

        private static void WriteDouble<T>(T d)
        {
            Console.WriteLine(string.Format("{0:0.000000000}", d).Replace(',', '.'));
        }

        private static void WL<T>(T s)
        {
            Console.WriteLine(s);
        }

        private static void W<T>(T s)
        {
            Console.Write(s);
        }

        private static void Assert(bool b)
        {
            if (!b) throw new Exception();
        }

        private static void Swap<T>(ref T a, ref T b)
        {
            var temp = a;
            a = b;
            b = temp;
        }

        #endregion
    }
}

using System;

namespace ConsoleApplication3
{
    class Program
    {
        static long Vector(long x1, long y1, long x2, long y2, long x3, long y3)
        {
            long ax = x2 - x1;
            long ay = y2 - y1;
            long bx = x3 - x1;
            long by = y3 - y1;
            return ax * by - ay * bx;
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            Console.WriteLine(n-a);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Globalization;

namespace _WastedTime
{
	public class Point
	{
		public double x;
		public double y;
	}

    public class ProgramWastedTime
    {
    	public static double Distance(Point p1, Point p2)
    	{
    		var xdist = p2.x-p1.x;
    		xdist = xdist*xdist;
    		var ydist = p2.y-p1.y;
    		ydist = ydist*ydist;

    		return Math.Sqrt(xdist+ydist);
    	}

        public static void Main(string[] args)
        {
        	Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us");

        	Point p1 = null;
        	Point p2 = null;

        	double total = 0.0;
        	string line;
        	line = Console.ReadLine();
        	var parms = line.Split(' ');
        	var n = int.Parse(parms[0]);
        	var k = double.Parse(parms[1]);
        	while ((line = Console.ReadLine()) != null)
        	{
        		var point = line.Split(' ');
        		var p = new Point { x=double.Parse(point[0]),
        			y=double.Parse(point[1]) };
        		if (p1 == null)
        		{
        			p1 = p;
        		} else {
        			p2 = p;
        			total += Distance(p1, p2);
        			p1 = p2;
        		}
        	}
        		Console.WriteLine("{0:N10}", (total/50.0)*k);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _NumPos
{
    class ProgramNumPos
    {
        static void GetParams(string input, out int n, out int a, out int b)
        {
            var splitParams = input.Split();
            n = Convert.ToInt32(splitParams[0]);
            a = Convert.ToInt32(splitParams[1]);
            b = Convert.ToInt32(splitParams[2]);
        }

        static string Run(string input)
        {
            int n, a, b;

            GetParams(input, out n, out a, out b);

            return string.Format("{0}", n - a);
        }

        static void Main(string[] args)
        {
            var inputs = new List<string>();
            if (args.Length == 0)
            {
                var input = Console.ReadLine();
                inputs.Add(input);
            } else
            {
                var input = string.Empty;
                while (input != "-1")
                {
                    input = Console.ReadLine();
                    if (input != "-1") inputs.Add(input);
                }
            }

            foreach (var test in inputs)
            {
                Console.WriteLine(Run(test));
            }
        }
    }
}

using System;
using System.Text;

namespace Codeforces
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            Solve();
        }

        private static void Solve()
        {
            var nab = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

            Console.WriteLine(nab[0] - nab[1]);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {

        static void Main()
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            if (a + b != n)
                Console.WriteLine(b + 1);
            else
                Console.WriteLine(b);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {

        static void Main()
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            Console.WriteLine(n-a);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {

        static void Main()
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            Console.WriteLine(b + 1);
        }
    }
}

// #using System.Collections.Generic;
using System;

namespace A
{
    class MainClass
    {
        public static void Main ()
        {
            string[] test = Console.ReadLine ().Split (' ');
            int n = int.Parse (test [0]), a = int.Parse (test [1]), b = int.Parse (test [2]);
            n = n - a;
            if (n > b+1)
                n -= (n - b);

            Console.WriteLine (n);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = 0;
            string n = Console.ReadLine();
            string[] a = n.Split(' ');
            k = (int.Parse(a[0]) - int.Parse(a[1])) - (int.Parse(a[0]) - int.Parse(a[1]) - int.Parse(a[1]));
            Console.WriteLine(k+1);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = 0;
            int ans = 0;
            string n = Console.ReadLine();
            string[] a = n.Split(' ');
            k = int.Parse(a[0]) - int.Parse(a[1]);
      //      if (k >= int.Parse(a[1]))
       //         ans = k;
            Console.WriteLine(k);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace A.Количество_позиций
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            if (a + b > n)
                n = n - a;
            else if (a + b == n)
                n = n - a;
            else
                n = n - b;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace A.Количество_позиций
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            if (a + b > n)
                n = n - a;
            else if (a + b == n)
                n = n - a;
            else
                n = n - b;
            Console.WriteLine(n);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace A.Количество_позиций
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int a = Convert.ToInt32(s[1]);
            int b = Convert.ToInt32(s[2]);
            if (a + b > n)
                n = n - a;
            else if (a + b == n)
                n = n - a;
            else
                n = n - b;
            Console.WriteLine(n);
        }
    }
}

using System;
using System.Collections;
using System.Text;

namespace Dictionary
{
    class Program
    {

        static void Main(string[] args)
        {
            //string[] input = Console.ReadLine().Split(' ');
            string[] input = "5 2 3".Split(' ');
            int n = int.Parse(input[0]);
            int a = int.Parse(input[1]);
            int b = int.Parse(input[2]);
            int cur = n - a;

            Console.WriteLine(cur>b?b+1:cur);

        }

    }
}

using System;

namespace _92D2A
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            Console.WriteLine(n - a);
            Console.ReadLine();
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            var t = Console.ReadLine();
            var tt = t.Split(' ');
            int n = int.Parse(tt[0]);
            int a = int.Parse(tt[1]);
            int b = int.Parse(tt[2]);

            Console.Write(Math.Max(a + 1, n - b - 1));

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleProblem
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');

            int n = int.Parse(s[0].ToString());
            int a = int.Parse(s[1].ToString());
            int b = int.Parse(s[2].ToString());

            int k = n - a;

            int t = n - b;

            Console.WriteLine(n - (Math.Max(k,t) - 1));

           // Console.ReadLine();

        }
    }
}

using System;

namespace _4A_watermelon
{
    class Program
    {
        static void Main(string[] args)
        {
            string line= Console.ReadLine();
            string[]tok=line.Split(' ');
            int n=int.Parse(tok[0]),a=int.Parse(tok[1]);
                     Console.WriteLine("{0}",n-a);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] s = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int n = s[0];
            int a = s[1];
            int b = s[2];
            int y = n - a + b;
            Console.WriteLine(y);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CF._124A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] nab = Console.ReadLine().Split();
            int n = int.Parse(nab[0]);
            int a = int.Parse(nab[1]);
            int b = int.Parse(nab[2]);
            int ans = 0;
            if (a + 1 > n - b)
                ans = n - a;
            else
                ans = b;
            if (ans <= 0)
                Console.WriteLine("0");
            else
                Console.WriteLine(ans.ToString());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CF._124A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] nab = Console.ReadLine().Split();
            int n = int.Parse(nab[0]);
            int a = int.Parse(nab[1]);
            int b = int.Parse(nab[2]);
            int ans = 0;
            if (a + 1 >= n - b)
                ans = n - a;
            else
                ans = b;
            if (ans <= 0)
                Console.WriteLine("0");
            else
                Console.WriteLine(ans.ToString());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;

namespace codeforces
{
	class Program
	{
		public class User
		{
			public int c;

			public int r;
		}

		public class Comparer : IComparer<User>
		{
			public int Compare(User x, User y)
			{
				if (x.c < y.c)
					return -1;
				return 1;
			}
		}

		public static long getGcd(long a, long b)
		{
			if (b == 0)
				return a;
			return getGcd(b, a % b);
		}

		public static void WriteYESNO(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string GetString()
		{
			return Console.ReadLine();
		}

		public static List<int> getList()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static int Min(int x, int y)
		{
			return Math.Min(x, y);
		}

		public static int Max(int x, int y)
		{
			return Math.Max(x, y);
		}

		public static int Abs(int x)
		{
			return Math.Abs(x);
		}

		public static int getInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static bool Equal(int x, int y, int x1, int y1)
		{
			return x == x1 && y == y1;
		}

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/
			var arr = getList();
			Console.WriteLine(arr[0] - Max(arr[1], arr[0] - arr[2]));
			/*			input.Close();
			output.Close();*/
		}
	}
}

using System;
using System.Linq;

namespace _124A
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int i=0;
            while (s[0] - (s[1] + i + 1) >=0 && (s[0] - (s[1] + i + 1) <= s[2]))
            {
                i++;
            }
            Console.WriteLine(i);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

        var n = int.Parse(input[0]);
        var a = int.Parse(input[1]);

        Console.WriteLine(n-a);
    }
}

using System;
class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(new char[] { '\t', ' ' }, StringSplitOptions.RemoveEmptyEntries);
            Console.WriteLine(int.Parse(input[0]) - int.Parse(input[1]));
        }
    }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int p = nums[0];
            int bef = nums[1];
            int aft = nums[2];

            int ans = (p - bef + aft) > p ? p - bef : aft + 1;
            Console.WriteLine(ans);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int p = nums[0];
            int bef = nums[1];
            int aft = nums[2];

            int ans = (bef + aft) > p ? p - bef : aft + 1;
            Console.WriteLine(ans);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int p = nums[0];
            int bef = nums[1];
            int aft = nums[2];

            Console.WriteLine(p - bef);
            Console.ReadLine();
        }
    }
}

using System;
using System.Linq;

namespace Test
{
    class Program
    {
        static void Main()
        {
            byte[] arrInput = Console.ReadLine().Split(' ').Select(x => Convert.ToByte(x)).ToArray();
            Console.WriteLine(arrInput[0] - arrInput[1]);
        }
    }
}

using System;
using System.Linq;

namespace Test
{
    class Program
    {
        static void Main()
        {
            byte[] arrInput = Console.ReadLine().Split(' ').Select(x => Convert.ToByte(x)).ToArray();
            Console.WriteLine((arrInput[0] - arrInput[1] - 1) >  arrInput[2] ? (arrInput[0] - arrInput[1] - 1) : (arrInput[0] - arrInput[1]));
        }
    }
}

using System;
using System.Linq;
class Demo
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Console.WriteLine(a[0] - a[1]);
    }
}

using System;
using System.Linq;

class Program{
  static void Main() {
    var s  = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    Console.WriteLine(s[0] - s[2] - s[1]);
  }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A.The_number_of_positions
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            Console.WriteLine(n - a);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            long n = Int64.Parse(input[0]);
            long a = Int64.Parse(input[1]);
            long b = Int64.Parse(input[2]);

            long output = n - a;
            Console.WriteLine(output.ToString());
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace MTests
{
    static class Program {

        internal static void MyMain()
        {

            var ints = RInts();

            WLine(ints[0]-ints[1]);

        }

        static void Main(string[] args)
        {

#if !HOME
            MyMain();
#else
            Secret.MyMain();
#endif
        }

        #region Utils
        static string RLine()
        {
            return Console.ReadLine();
        }

        static string[] RLine(string separator = " ")
        {
            return Console.ReadLine().Split(new string[] { separator }, StringSplitOptions.None);
        }

        static int RInt()
        {
            var str = Console.ReadLine();
            return Convert.ToInt32(str);
        }

        static int[] RInts()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt32(s));
        }
        static void RInts(out int a, out int b)
        {
            var ints = RInts();
            a = ints[0];
            b = ints[1];
        }

        public static void WLine<T>(IEnumerable<T> list) {
            if (list is string)
            {
                Console.WriteLine(list);
            }
            else {
                Console.WriteLine(string.Join(" ", list));
            }

        }

        public static void WLine(params object[] s)
        {
            Console.WriteLine(string.Join(" ",s));
        }

        public static void WLine(object s)
        {
            Console.WriteLine(s);
        }
        #endregion

    }
}

using System;
using System.IO;
using System.Text;

namespace The_number_of_positions
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();
            int a = Next() + 1;
            int b = Next();
            int pos = Math.Max(a, n - b - 1);

            writer.WriteLine(n - pos + 1);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] data = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(data[0]);
            int b = Convert.ToInt32(data[1]);
            int c = Convert.ToInt32(data[2]);

            Console.WriteLine(a - b);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            var q = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Console.WriteLine(q[0] - q[1]);

            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            var q = Console.ReadLine().Split().Select(int.Parse).ToArray();

            if (q[0] - q[1] > q[2])
                Console.WriteLine(q[0] - q[1]);
            else
                Console.WriteLine(q[2]);

            Console.ReadLine();
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;

public class App1
{
    public static void Main()
    {
        Func<string> read = ()=>Console.ReadLine();
        Action<object> write = _=>Console.WriteLine(_.ToString());

        var t=read().ToIntA();
        int n=t[0],a=t[1],b=t[2];

        var x=n-a;
        write((x<=b)?x:x-b);
    }
}

static class Exts
{
    public static int ToInt(this string s)
    {
        return int.Parse(s);
    }

    public static int[] ToIntA(this string s)
    {
        return SplitBySpace(s).Select(ToInt).ToArray();
    }

    public static string[] SplitBySpace(this string s)
    {
        return s.Split(new[]{" "},StringSplitOptions.RemoveEmptyEntries);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _41a
{

    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            if((a-b)==1)
            {
            Console.WriteLine((n-a)-1);
            }
            else Console.WriteLine(n-a);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace broze
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
            if (n[1] == 0 &&n[2]!=0)
            {
                Console.WriteLine(n[0] - n[2] + 1);
            }
            else if (n[1] == 0 && n[2] == 0)
            {
                Console.WriteLine(n[0]);
            }
            else
            {
                Console.WriteLine(n[0] - n[1]);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split();
            int n = int.Parse(input[0]);
            int a = int.Parse(input[1]);
            int b = int.Parse(input[2]);

            int posCount = n - a;

            Console.WriteLine(b < posCount - 1 ? posCount - b : posCount);
            Console.Read();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication252
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            int c = n - a;
            if (c-1 > b)
            {
                Console.WriteLine(c - b);
            }
            else
            {
                Console.WriteLine(c);
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication252
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            int c = a - b;
            if (c > b)
            {
                Console.WriteLine(c - b);
            }
            else
            {
                Console.WriteLine(b);
            }

        }
    }
}

using System;
using System.Linq;

namespace tren
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] mass = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            Console.Write(mass[0] - mass[1]);
        }
    }
}

using System;
using System.Linq;

namespace tren
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] mass = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int count = 0;
            for(int i = mass[1]; i < mass[0]; i++)
            {
                if (mass[0] - i <= mass[1]) count++;
            }
            Console.Write(count);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;

namespace Problem124A {
    class Program {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split(' ');
            int peopleInLine = Convert.ToInt32(input[0]);
            int inFront = Convert.ToInt32(input[1]);
            int behind = Convert.ToInt32(input[2]);

            int positions = peopleInLine - inFront;
            Console.WriteLine(positions);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string[] arr1 = a.Split(' ');
            int sub = int.Parse(arr1[0]) - int.Parse(arr1[1]);
            while (sub == (int.Parse(arr1[2])) + 1) sub--;
            Console.Write(sub);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string[] arr1 = a.Split(' ');
            int sub = int.Parse(arr1[0]) - int.Parse(arr1[1]);
            Console.Write(sub);
        }
    }
}