import java.util.*; class Main{ public static void main(String[] $) { Scanner s=new Scanner(System.in); long a=s.nextLong(),b=s.nextLong(),c=s.nextLong(); long r=c; if(a<=c) --r; if(b<=c) --r; System.out.println(r); } }