import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x = scan.nextInt(); int y = scan.nextInt(); int d = scan.nextInt(); scan.close(); if(x + y < d) { System.out.println(0); System.exit(0); } if(x >= d && y >= d) { System.out.println(d + 1); }else if(x < d && y >= d) { int ans = d + 1 - (d - x); System.out.println(ans); }else if(x >= d && y < d) { int ans = d + 1 - (d - y); System.out.println(ans); }else { int ans = d + 1 - (d - x) - (d - y); System.out.println(ans); } } }