import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto nmx = readints;
    int n = nmx[0], m = nmx[1], x = nmx[2];
    auto a = readints;

    auto xs = new int[n + 2];
    for (int i = 0; i < a.length; i++) {
        xs[a[i]] = 1;
    }

    int s = xs[0..x].sum;
    int t = xs[x+1..$].sum;
    writeln(min(s, t));
}
