import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final long x = sc.nextLong(); final long y = sc.nextLong(); final long d = sc.nextLong(); System.out.println(Math.max(0, (d + 1) - Math.max(0, d - x) - Math.max(0, d - y))); } }