import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class MainTest { static long countArray(int n, int k, int x) { int[] array = new int[n]; array[0] = 1; array[n-1] = x; long count = 1; for(int i = 0; i =n)){ if(array[i] != array[i-1] && array[i] != array[i+1]){ count++; } } } } return count; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int x = in.nextInt(); long answer = countArray(n, k, x); System.out.println(answer); in.close(); } }