import java.util.*; import java.io.*; import java.awt.geom.*; import static java.util.Arrays.*; class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int x = Integer.parseInt(stdIn.next()); int y = Integer.parseInt(stdIn.next()); int d = Integer.parseInt(stdIn.next()); int count = d+1; if(x-d<0){ count += x-d; } if(y-d<0){ count += y-d; } if(count<0){ count = 0; } out.println(count); out.flush(); } }