import java.util.Scanner; public class No126 { public static void main (String[] args) { Scanner sc=new Scanner(System.in); int a,b,s,count; a=sc.nextInt(); b=sc.nextInt(); s=sc.nextInt(); count=0; if(a==0){count++;a++;}; if(a>s)count+=a; else count+=Math.min(Math.abs(a-s),Math.abs(b-s))+s; System.out.println(count); } }