unittest
{
	assert( [ "4", "west", "east", "wait" ].parse.expand.solve == 3 );
	assert( [ "9", "different", "different", "different" ].parse.expand.solve == 0 );
	assert( [ "7", "zenkoku", "touitsu", "program" ].parse.expand.solve == 13 );
}



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 a = input.front;
	input.popFront;
	auto b = input.front;
	input.popFront;
	auto c = input.front;
	return tuple( a, b, c );
}

auto solve( string a, string b, string c )
{
	auto ans = 0L;
	foreach( ac, bc, cc; lockstep( a, b, c ) )
	{
		if(      ac != bc && bc != cc && cc != ac ) ans += 2;
		else if( ac != bc || bc != cc || cc != ac ) ans += 1;
	}
	return ans;
}
