Perl 6, 38 bytes
{+(1...all ~*∉$_,*.comb==.max.comb)}
Anonymous codeblock that takes input as a list of two elements, and returns the first number that is the same length as the element with the maximum length, and is not equal to either string.