unittest
{
	assert( [ "0 2 3 4 5" ].parse.expand.solve == 1 );
	assert( [ "1 2 0 4 5" ].parse.expand.solve == 3 );
}



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

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

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto xs = input.front.split.to!( long[] );
	return tuple( xs );
}

auto solve( long[] xs )
{
	foreach( i, x; xs.enumerate( 1 ) )
	{
		if( i != x ) return i;
	}
	assert( false );
}
