import java.util.Scanner; public class No_103 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int d = sc.nextInt(); int count = 0; if (x + y < d) { System.out.println(count); return; } int tx = 0; int ty = 0; if(x >= y){ tx = d; while(tx >= 0 && ty <= y){ tx-=1; ty+=1; count+=1; } }else{ ty = d; while(ty >= 0 && tx <= x){ ty-=1; tx+=1; count+=1; } } System.out.println(count); } }