import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); int Z = sc.nextInt(); int day = X <= Z ? Z-1 : Z; day = Y <= Z ? day-1 : day; println(day); } public static void print(Object o) { System.out.print(o); } public static void println(Object o) { System.out.println(o); } }