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