unittest
{
	assert( [ "12" ].parse.expand.solve == 1 );
	assert( [ "5" ].parse.expand.solve == 0 );
	assert( [ "1000000000000000000" ].parse.expand.solve == 124999999999999995 );
}

unittest
{
	// 追加ケース
	import std.algorithm;
	import std.bigint;
	import std.format;
	BigInt test( long n )
	{
		if( n < 2 ) return BigInt( 1 );
		else        return n * test( n - 2 );
	}
	foreach( i; 0 .. 10001 )
	{
		auto k = format( "%d", test( i ) );
		assert( solve( i ) == k.length.signed - k.retro.find!( ( a ) => a != '0' ).walkLength.signed );
	}
}



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

auto solve( long n )
{
	// 10未満と奇数は末尾が0にならないので除外
	if( n < 10 || n % 2 == 1 ) return 0;
	
	// 10 * 5 ^^ i ごとに末尾の0が増える数が増える
	n /= 10;
	auto ans = n;
	for( auto i = 1L; 5L ^^ i <= n; i++ )
	{
		ans += n / ( 5L ^^ i );
	}
	return ans;
}
