unittest
{
	assert( [ "1" ].solve == 0 );
	assert( [ "0" ].solve == 1 );
}



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

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

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto x = input.front.to!( long );
	
	return ( x + 1 ) % 2;
}
