AlgoUniversity
  • Go Back
Easy Transform :

Author

admin

Difficulty Level : Easy

Submissions : 31696

Asked In :

Marks :10

: 98 | : 206

You are given $$$N$$$ numbers. You are allowed to perform a "drop" operation where you simply choose any one of the $$$N$$$ given numbers and remove it. After dropping the $$$i$$$-th number: the number to left of it, and the number to right of it become adjacent numbers.

Your task is to minimize the number of drop operations to get a resulting set of numbers where the sum of every two adjacent numbers is even.

Input

First line has a single integer $$$N$$$. Second line has $$$N$$$ space-separated integers.

Constraints

$$$1 \leq N \leq 10^5$$$

$$$-10^4 \leq$$$ each element of the array $$$\leq 10^4$$$

Output

A single integer representing the minimum number of drop operations required.

Example

Input
3
1 2 3
Output
1

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.