There are b boys and g girls participating in Olympiad of Metropolises. There will be a board games tournament in the evening and n participants have accepted the invitation. The organizers do not know how many boys and girls are among them.

Organizers are preparing red badges for girls and blue ones for boys.

Vasya prepared n+1 decks of badges. The i-th (where i is from 0 to n, inclusive) deck contains i blue badges and n-i red ones. The total number of badges in any deck is exactly n.

Determine the minimum number of decks among these n+1 that Vasya should take, so that there will be a suitable deck no matter how many girls and boys there will be among the participants of the tournament.

Input

The first line contains an integer b (1 ≤ b ≤ 300), the number of boys. 

The second line contains an integer g (1 ≤ g ≤ 300), the number of girls. 

The third line contains an integer n (1 ≤ n ≤ b + g), the number of the board games tournament participants.

Output

Output the only integer, the minimum number of badge decks that Vasya could take.

Examples

Input


5
6
3


Output


4


Input


5
3
5


Output


4

Note

In the first example, each of 4 decks should be taken: (0 blue, 3 red), (1 blue, 2 red), (2 blue, 1 red), (3 blue, 0 red).

In the second example, 4 decks should be taken: (2 blue, 3 red), (3 blue, 2 red), (4 blue, 1 red), (5 blue, 0 red). Piles (0 blue, 5 red) and (1 blue, 4 red) can not be used.
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class a{ 
     static int[] count,count1;
     static Node[] arr;
     static char[] ch,ch1;
     static long[] darr;
     static long[][] mat;
     static long x;
     static long maxl;
     static double dec;
     static String s;
     // static long minl;
     static int mx = (int)1e6;
     static long mod = 998244353l;
     // static int minl = -1;
     // static long n;
     static int n,n1,n2;
     static long a,g;
     static long b;
     static long c;
     static long d;
     static long y;
     static long m;
     static long k;
     static int q;
     static String[] str,str1;
     static Set<Character> set,set1;
     static List<Long> list;
     static Map<Long,Integer> map;
     static StringBuilder sb;

     public static long solve(){

        return Math.min(n,g) - (n-Math.min(n,b)) + 1; 

     }

     public static void main(String[] args) {

            FastScanner sc = new FastScanner();
            // Scanner sc = new Scanner(System.in);
            // int t = sc.nextInt();
            int t = 1;
            while(t > 0){
                 // set = new HashSet<>();
                 // map = new HashMap<>();
                
                // x = sc.nextLong();
                // y = sc.nextLong();
                
                // a = sc.nextLong();
                b = sc.nextLong();
                g = sc.nextLong();
                n = sc.nextInt();
                // n1 = sc.nextInt();
                // n1 = sc.nextInt();

                
                // c = sc.nextLong();
                // d = sc.nextLong();
                // k = sc.nextLong();
                // d = sc.nextLong();
                // n = sc.nextLong();
                // x = sc.nextLong();
                // ch = sc.next().toCharArray();
                // ch1 = sc.next().toCharArray();
                // s = sc.next();

                 // long x = sc.nextLong();

                
                // k = sc.nextLong();
                // dec = sc.nextDouble();
                // n = sc.nextInt();
                // m = sc.nextLong();
                // x = sc.nextLong();
                 
                // arr = new Node[n];
                // for(int i = 0; i < n ; i++){
                //     arr[i] = new Node(sc.nextInt(),i+1);
                // }
                // // set = new HashSet<>();
                // for(int i = 0 ; i < n ; i++)
                //     set.add(sc.next().charAt(0));
                
                // n1 = sc.nextInt();
                //  darr = new long[n1];
                //  for(int i = 0; i < n1 ; i++){
                //      darr[i] = sc.nextLong();
                //  }

                // mat = new long[n][n1];

                // for(int i = 0 ; i < n ; i++){
                //     for(int j = 0 ; j < n1 ; j++){
                //         mat[i][j] = sc.nextLong();
                //     }
                // }


                // System.out.println(solve()?"YES":"NO");
                 // solve();
                 System.out.println(solve());
                 // sb = new StringBuilder();
                 // sb.append(str);

                 t -= 1;
            }

     }

    public static int log(long n){

         if(n == 0 || n == 1)
             return 0;

         if(n == 2)
             return 1;

         double num = Math.log(n);
         double den = Math.log(2);

         if(den == 0)
             return 0;

         return (int)(num/den);
     }

     public static long gcd(long a,long b){

        if(b%a == 0)
            return a;

        return gcd(b%a,a);

     }

     // public static void swap(int i,int j){
     //     long temp = arr[j];
     //     arr[j] = arr[i];
     //     arr[i] = temp;
     // } 

    static final Random random=new Random();
    
    static void ruffleSort(long[] a) {
        int n=a.length;//shuffle, then sort 
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n);
            long temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }

    static class Node{
        int first;
        int second;
        Node(int f,int s){
            this.first = f;
            this.second = s;
        }
    }

     static class FastScanner {

                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                StringTokenizer st=new StringTokenizer("");
                String next() {
                        while (!st.hasMoreTokens())
                                try {
                                        st=new StringTokenizer(br.readLine());
                                } catch (IOException e) {
                                        e.printStackTrace();
                                }
                        return st.nextToken();
                }
                
                int nextInt() {
                        return Integer.parseInt(next());
                }
                int[] readArray(int n) {
                        int[] a=new int[n];
                        for (int i=0; i<n; i++) a[i]=nextInt();
                        return a;
                }
                long nextLong() {
                        return Long.parseLong(next());
                }
        }

}