($X,$Y,$Z)=glob<>; print$Z-($X<=$Z)-($Y<=$Z)