There are n buckets arranged in a row. each bucket either is empty or contains a ball. the buckets are specified as a string buckets consisting of characters '.' and 'B' in one move you can take the ball out of any bucket and place it in another empty bucket. your goal is to arrange the balls to create an alternating sequence of full and empty buckets. distance between two consecutive balls should be equal to 2, note that the sequence may start at any bucket we need to give what is minimum numbers of moves required to create a correct sequence of balls in bucket. If it is impossible return -1
Sample Input 1:
BB.B.BBB...
Sample Output 1:
4
Sample Input 2:
..B....B.BB
Sample Output 2:
2


