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