#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long odd = 0, even;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] & 1) odd++;
  }
  even = n - odd;
  long long ans = 0;
  if (odd == 0)
    ans = 0;
  else if (odd <= even) {
    ans = odd;
  } else {
    ans = even;
    odd = odd - even;
    ans = ans + ((odd) / 3);
  }
  cout << ans << "\n";
  return 0;
}

### Prompt

Create a solution in cpp for the following problem:

A flower shop has got n bouquets, and the i-th bouquet consists of ai flowers. Vasya, the manager of the shop, decided to make large bouquets from these bouquets. 

Vasya thinks that a bouquet is large if it is made of two or more initial bouquets, and there is a constraint: the total number of flowers in a large bouquet should be odd. Each of the initial bouquets can be a part of at most one large bouquet. If an initial bouquet becomes a part of a large bouquet, all its flowers are included in the large bouquet.

Determine the maximum possible number of large bouquets Vasya can make. 

Input

The first line contains a single positive integer n (1 ≤ n ≤ 105) — the number of initial bouquets.

The second line contains a sequence of integers a1, a2, ..., an (1 ≤ ai ≤ 106) — the number of flowers in each of the initial bouquets.

Output

Print the maximum number of large bouquets Vasya can make. 

Examples

Input

5
2 3 4 2 7


Output

2


Input

6
2 2 6 8 6 12


Output

0


Input

3
11 4 10


Output

1

Note

In the first example Vasya can make 2 large bouquets. For example, the first bouquet can contain the first and the fifth initial bouquets (the total number of flowers is then equal to 9), and the second bouquet can consist of the second and the third initial bouquets (the total number of flowers is then equal to 7). The fourth initial bouquet is unused in this scheme. 

In the second example it is not possible to form a single bouquet with odd number of flowers.

In the third example Vasya can make one large bouquet. For example, he can make it using all three initial bouquets. The size of the large bouquet is then equal to 11 + 4 + 10 = 25.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long odd = 0, even;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] & 1) odd++;
  }
  even = n - odd;
  long long ans = 0;
  if (odd == 0)
    ans = 0;
  else if (odd <= even) {
    ans = odd;
  } else {
    ans = even;
    odd = odd - even;
    ans = ans + ((odd) / 3);
  }
  cout << ans << "\n";
  return 0;
}

```