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; } for (int i = 0; i <= x; i++) { int dis = d - i; if(dis <= y) count+=1; } System.out.println(count); } }