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