There are N days left for the Quidditch Match between Gryffindor and Slytherin
Madam Hooch , the Quidditch Coach of Hogwarts has decided to schedule practice of Quidditch for Gryffindor and Slytherin, but wishes to have alternating days for both. i.e, if on a day Slytherin practices, Gryffindor practices the next day and vice versa and on a day, only one team can practice.
Harry has made a schedule as an array A of 1s and 0s. "1" denotes the days Gryffindor practices and "0" as the days they don't. (i.e Slytherin practices on those days)
Madam Hooch doesn't seem to be satisfied with Harry's random schedule .She asks Harry to modify his schedule so that both teams practice on alternate days. For each 0 converted to 1, X points are taken from Gryffindor while for each 1 converted to 0, Y points are taken from Gryffindor. Harry needs to take care of the House cup as well as has to ensure that minimum points are taken from Gryffindor.
What is the minimum points that could be taken from Gryffindor?
Input format
Output format
Constraints:
For the first test case
Harry's schedule : 1 1
He can either make it "0 1" losing 1 point OR "1 0" losing 1 point.
So total points deducted = 1
For the second test case
Harry's schedule : 0 1
This already satisfies Madam Hooch's condition .
So total points deducted = 0