Given a string s, return the length of the longest substring that contains at most two distinct characters.