import java.util.Scanner; public class Main { public static void main(String[] a) { Scanner s = new Scanner(System.in); int x=s.nextInt(),y=s.nextInt(),d=s.nextInt(); System.out.println(d>x+y?0:(x>d?d:x)-(y>d?0:d-y)+1); } }