package no131; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int d = sc.nextInt(); System.out.println(solve(x,y,d)); } public static long solve(long x,long y,long d) { if (d > x + y) { return 0; } long right = d <= x ? d : x; long left = d <= y ? 0 : d - y; return right - left + 1; } }