unittest
{
	assert( [ "internationalization" ].parse.expand.solve == "i18n" );
	assert( [ "smiles" ].parse.expand.solve == "s4s" );
	assert( [ "xyz" ].parse.expand.solve == "x1z" );
}



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 s = input.front.strip;
	return tuple( s );
}

auto solve( string s )
{
	return s[ 0 ] ~ ( s.length - 2 ).to!string ~ s[ $ - 1 ];
}
