unittest
{
	assert( [ "8" ].parse.expand.solve == 2 );
	assert( [ "2" ].parse.expand.solve == 0 );
	assert( [ "9" ].parse.expand.solve == 3 );
}



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 n = input.front.strip.to!( long );
	return tuple( n );
}

auto solve( long n )
{
	return n / 3;
}
