program main implicit none integer::x,y,d read *,x,y,d if(x+y.lt.d) then print '(i0)',0 else print '(i0)',abs(dim(d,y)-MIN(x,d)) + 1 end if end program main