import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); long x=sc.nextLong(); long y=sc.nextLong(); long z=sc.nextLong(); if(z>=y)System.out.println(z-2); else if(y>=z&&z>=x)System.out.println(z-1); else if(x>z)System.out.println(z); } }