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