import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in)); try { String[] line = stdReader.readLine().split(" "); int x = Integer.parseInt(line[0]); int y = Integer.parseInt(line[1]); int d = Integer.parseInt(line[2]); int ans = 0; int temp = 0; if(x>y) temp=x; else temp = y; for(int i=0;i<=temp;i++){ for(int j=0;j<=temp;j++){ if(x>=i && y>= j && i+j==d) ans++; } } System.out.println(ans); } catch (IOException e) { e.printStackTrace(); } } }