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