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){ if(x >= d){ tx = d; }else{ tx = x; ty = d - x; } while(tx >= 0 && ty <= y){ tx-=1; ty+=1; count+=1; } }else{ if(y >= d){ ty = d; }else{ ty = y; tx = d - y; } while(ty >= 0 && tx <= x){ ty-=1; tx+=1; count+=1; } } System.out.println(count); } }