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