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