문제
Bessie and Elsie were playing a game on a boolean array
Farmer John has stumbled upon the game board and is curious to know the minimum number of swaps between adjacent elements needed so that the game looks like it was a tie. Please help out Farmer John figure out the answer to this question.
Problem credits: Dhruv Rohatgi
입력
The first line of input contains
출력
Please write the number of adjacent swaps needed to make the game tied.
예제1
5
0 0 0 1 0 1 0 0 0 1
1
In this example, the first half of the array initially has