unittest
{
	assert( [ "10", "aabbbbaaca" ].parse.expand.solve == 5 );
	assert( [ "5", "aaaaa" ].parse.expand.solve == 1 );
	assert( [ "20", "xxzaffeeeeddfkkkkllq" ].parse.expand.solve == 10 );
}



import std.algorithm;
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 ) )
{
	input.popFront;
	auto s = input.front.to!( dchar[] );
	return tuple( s );
}

auto solve( dchar[] s )
{
	return s.group.walkLength;
}
