unittest
{
	assert( [ "5 3 3", "1 2 4" ].parse.expand.solve == 1 );
	assert( [ "7 3 2", "4 5 6" ].parse.expand.solve == 0 );
	assert( [ "10 7 5", "1 2 3 4 6 8 9" ].parse.expand.solve == 3 );
}



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

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nmx = input.front.split.to!( long[] );
	input.popFront;
	auto cs = input.front.split.to!( long[] );
	
	return tuple( nmx[ 0 ], nmx[ 2 ], cs );
}

auto solve( long n, long x, long[] cs )
{
	auto as = new long[ n + 1 ];
	
	foreach( c; cs )
	{
		as[ c ] = 1;
	}
	
	return min( as[ 0 .. x ].sum, as[ x + 1 .. $ ].sum );
}
