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); int X = sc.nextInt(); int Y = sc.nextInt(); int Z = sc.nextInt(); int cnt = 0; for(int i=1; i <= Z; i++) { if(i == X) { } else if (i == Y) { } else { cnt++; } } System.out.println(cnt); } }