A string of length consisting of s and s is given. By repeatedly performing the operation of swapping two adjacent characters, you want to make the number of adjacent character pairs that are different from each other be even. Find the minimum number of operations required. Print -1 if it is impossible.
Input
The input is given in the following format.
Output
Print the answer to the problem on the first line.
Constraints
- .
- ().
Subtasks
Samples
예제 1
입력
3
011
출력
1
예제 2
입력
2
01
출력
-1