import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int numOfTr = sc.nextInt();
    int numOfCost = sc.nextInt();
    int current = sc.nextInt();
    int[] cost = new int[numOfCost];
    for (int i = 0; i < numOfCost; i++) {
      cost[i] = sc.nextInt();
    }
    int left = 0;
    int right = 0;
    for (int i = 0; i < current; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    }
    for (int i = current + 1; i < numOfTr + 1; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    }
    System.out.println(left < right ? left : right);
  }

} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int numOfTr = sc.nextInt();
    int numOfCost = sc.nextInt();
    int current = sc.nextInt();
    int[] cost = new int[numOfCost];
    for (int i = 0; i < numOfCost; i++) {
      cost[i] = sc.nextInt();
    }
    int left = 0;
    int right = 0;
    for (int i = 0; i < current; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    }
    for (int i = current + 1; i < numOfTr + 1; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    }
    System.out.println(left < right ? left : right);
  }

} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int numOfTr = sc.nextInt();
    int numOfCost = sc.nextInt();
    int current = sc.nextInt();
    int[] cost = new int[numOfCost];
    for (int i = 0; i < numOfCost; i++) {
      cost[i] = sc.nextInt();
    }
    int left = 0;
    int right = 0;
    for (int i = 0; i < current; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    }
    for (int i = current + 1; i < numOfTr + 1; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    }
    System.out.println(left < right ? left : right);
  } main {
    Scanner sc = new Scanner(System.in);
    int numOfTr = sc.nextInt();
    int numOfCost = sc.nextInt();
    int current = sc.nextInt();
    int[] cost = new int[numOfCost];
    for (int i = 0; i < numOfCost; i++) {
      cost[i] = sc.nextInt();
    }
    int left = 0;
    int right = 0;
    for (int i = 0; i < current; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    }
    for (int i = current + 1; i < numOfTr + 1; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    }
    System.out.println(left < right ? left : right);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int numOfTr = sc.nextInt(); numOfTr sc.nextInt() sc.nextInt sc int numOfCost = sc.nextInt(); numOfCost sc.nextInt() sc.nextInt sc int current = sc.nextInt(); current sc.nextInt() sc.nextInt sc int[] cost = new int[numOfCost]; cost new int[numOfCost] numOfCost for (int i = 0; i < numOfCost; i++) {
      cost[i] = sc.nextInt();
    } int i = 0; int i = 0; i 0 i < numOfCost i numOfCost i++ i++ i {
      cost[i] = sc.nextInt();
    } {
      cost[i] = sc.nextInt();
    } cost[i] = sc.nextInt() cost[i] cost i sc.nextInt() sc.nextInt sc int left = 0; left 0 int right = 0; right 0 for (int i = 0; i < current; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    } int i = 0; int i = 0; i 0 i < current i current i++ i++ i {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    } {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    } for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      } int j = 0; int j = 0; j 0 j < numOfCost j numOfCost j++ j++ j {
        if (i == cost[j]) {
          left++;
        }
      } {
        if (i == cost[j]) {
          left++;
        }
      } if (i == cost[j]) {
          left++;
        } i == cost[j] i cost[j] cost j {
          left++;
        } left++ left for (int i = current + 1; i < numOfTr + 1; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    } int i = current + 1; int i = current + 1; i current + 1 current 1 i < numOfTr + 1 i numOfTr + 1 numOfTr 1 i++ i++ i {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    } {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    } for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      } int j = 0; int j = 0; j 0 j < numOfCost j numOfCost j++ j++ j {
        if (i == cost[j]) {
          right++;
        }
      } {
        if (i == cost[j]) {
          right++;
        }
      } if (i == cost[j]) {
          right++;
        } i == cost[j] i cost[j] cost j {
          right++;
        } right++ right System.out.println(left < right ? left : right) System.out.println System.out System System.out left < right ? left : right left < right left right left right String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int numOfTr = sc.nextInt();
    int numOfCost = sc.nextInt();
    int current = sc.nextInt();
    int[] cost = new int[numOfCost];
    for (int i = 0; i < numOfCost; i++) {
      cost[i] = sc.nextInt();
    }
    int left = 0;
    int right = 0;
    for (int i = 0; i < current; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    }
    for (int i = current + 1; i < numOfTr + 1; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    }
    System.out.println(left < right ? left : right);
  }

} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int numOfTr = sc.nextInt();
    int numOfCost = sc.nextInt();
    int current = sc.nextInt();
    int[] cost = new int[numOfCost];
    for (int i = 0; i < numOfCost; i++) {
      cost[i] = sc.nextInt();
    }
    int left = 0;
    int right = 0;
    for (int i = 0; i < current; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    }
    for (int i = current + 1; i < numOfTr + 1; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    }
    System.out.println(left < right ? left : right);
  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int numOfTr = sc.nextInt();
    int numOfCost = sc.nextInt();
    int current = sc.nextInt();
    int[] cost = new int[numOfCost];
    for (int i = 0; i < numOfCost; i++) {
      cost[i] = sc.nextInt();
    }
    int left = 0;
    int right = 0;
    for (int i = 0; i < current; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          left++;
        }
      }
    }
    for (int i = current + 1; i < numOfTr + 1; i++) {
      for (int j = 0; j < numOfCost; j++) {
        if (i == cost[j]) {
          right++;
        }
      }
    }
    System.out.println(left < right ? left : right);
  }

}
