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