package algo; import java.util.Scanner; //import algo.*; public class sample7 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); long X = sc.nextLong(); long Y = sc.nextLong(); long Z = sc.nextLong(); long cnt = Z; if(Z >= X) { cnt -= 1; } if(Z >= Y) { cnt -= 1; } System.out.println(cnt); } }