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 = d+1; if(x+yx){ ans -= d-x; } if(d>y){ ans -= d-y; } } System.out.println(ans); } catch (IOException e) { e.printStackTrace(); } } }