import java.util.Scanner; public class P131 { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String n = sc.nextLine(); String[] nstrs = n.split(" "); int nint[] = new int[3]; for (int a=0;a<3;a++) { nint[a] = Integer.parseInt(nstrs[a]); } int x1 = nint[0]; int y1 = nint[1]; int d = nint[2]; int x; int ans = 0; for (x=x1;x>=0;x--) { if (d-x>=0 && y1>=(d-x)) { ans++; } } System.out.println(ans); } }