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