import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] first = br.readLine().split(" ", 3); int x = Integer.parseInt(first[0]); int y = Integer.parseInt(first[1]); int d = Integer.parseInt(first[2]); if (x + y < d) { System.out.println(0); return; } int x1 = Math.min(d, x); int x2 = Math.max(0, d - y); System.out.println(Math.abs(x1 - x2) + 1); } }