Developers at Amazon are testing a modified algorithm for sorting strings. Given a string strValue, find the minimum number of operations required to sort the string. Operation: Choose any proper substring of strValue and sort it. A proper substring of the string S is any substring of S except S itself. For example, if S = "adabc", then "adab" is a proper substring of S, while "adabc" is not. A string S is a substring of a string T if S can be obtained from T by deletion of several (possibly, zero or all) characters from the beginning and from the end.
3<=|strValue|<=1e6 strValue is restricted to containing only lowercase English letters. The allowed characters are within the range of [a-z].