You are given a string text. You can swap two of the characters in the text. Return the length of the longest substring with repeated characters.