func_code_string:
#include <bits/stdc++.h>
 using namespace std;
 const double PI = acos(-1.0);
 const double EPS = 1e-7;
 const long long BIG_PRIME7 = 1000000007;
 const long long BIG_PRIME9 = 1000000009;
 int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
 char ch =  a ;
 int j, n, m, L, i;
 int N, C;
 int x, y, z, k;
 string f, s;
 int a[101], b[101];
 int main() {
   cin >> x;
   for (i = 0; i < x; i++) {
     cin >> k;
     if (k & 1) z++;
   }
   if (!(z & 1))
     cout << (x - z);
   else
     cout << z;
   return 0;
 }


func_code_string:
#include <bits/stdc++.h>
 using namespace std;
 const int N = 111111;
 int last[3 * N], pre[3 * N], v[3 * N], cnt[3 * N], cur = 0;
 inline void add(int a, int b) {
   pre[cur] = last[a];
   v[cur] = b;
   last[a] = cur;
   cur++;
 }
 set<int>* who[N];
 inline set<int>* merge(set<int>*& a, set<int>*& b) {
   if (a->size() < b->size()) {
     return merge(b, a);
   } else {
     for (set<int>::iterator it = b->begin(); it != b->end(); it++) {
       if (a->find(-*it) != a->end()) {
         a->erase(-*it);
       } else {
         a->insert(*it);
       }
     }
     b->clear();
     return a;
   }
 }
 int used[N];
 void dfs(int u) {
   used[u] = true;
   for (int i = last[u]; i >= 0; i = pre[i])
     if (!used[v[i]]) {
       dfs(v[i]);
       cnt[i ^ 1] = cnt[i] = who[v[i]]->size();
       who[u] = merge(who[u], who[v[i]]);
     }
 }
 set<int>* mem[N];
 int main() {
   memset(last, -1, sizeof(last));
   int n;
   scanf( %d , &n);
   for (int i = (0); i <= ((n - 1) - 1); i++) {
     int u, v;
     scanf( %d%d , &u, &v);
     u--;
     v--;
     add(u, v);
     add(v, u);
   }
   for (int i = (0); i <= ((n)-1); i++) mem[i] = who[i] = new set<int>();
   int k;
   scanf( %d , &k);
   for (int i = (1); i <= ((k)); i++) {
     int u, v;
     scanf( %d%d , &u, &v);
     u--;
     v--;
     if (u != v) {
       who[u]->insert(i);
       who[v]->insert(-i);
     }
   }
   dfs(0);
   for (int i = 0; i < cur; i += 2) {
     if (i) printf(   );
     printf( %d , cnt[i]);
   }
   puts(  );
   for (int i = (0); i <= ((n)-1); i++) delete (mem[i]);
   return 0;
 }


func_code_string:
#include <bits/stdc++.h>
 using namespace std;
 const int MOD = 1e9 + 7;
 const int INF = 1e9 + 7;
 const int base = 1e9;
 const int MAX = 1e5;
 const double EPS = 1e-9;
 const double PI = acos(-1.);
 int main() {
   ios_base::sync_with_stdio(0);
   cin.tie(0);
   cout.tie(0);
   int n, *a, *res, j = 0;
   cin >> n;
   a = new int[n];
   res = new int[n];
   set<int> cnt;
   for (int i = 0; i < n; i++) {
     cin >> a[i];
   }
   for (int i = n - 1; i >= 0; i--) {
     if (!cnt.count(a[i])) {
       cnt.insert(a[i]);
       res[j] = a[i];
       j++;
     }
   }
   cout << j << endl;
   for (int i = j - 1; i >= 0; i--) {
     cout << res[i] <<    ;
   }
   return 0;
 }


func_code_string:
#include <bits/stdc++.h>
 using namespace std;
 struct cell {
   bool up, down, right, left;
   int degree;
   cell() { up = down = left = right = degree = 0; }
   void reset() { up = down = left = right = degree = 0; }
 };
 struct qcell {
   int x, y, degree;
   qcell() {
     x = y = -1;
     degree = 0;
   }
   qcell(int xx, int yy, int deg) {
     x = xx;
     y = yy;
     degree = deg;
   }
 };
 char pitch[2001][2001];
 cell info[2001][2001];
 int n, m;
 int empty_cells = 0;
 bool update(int x, int y) {
   int degree = 0;
   if (x >= 0 && x < n && y >= 0 && y < m) {
     degree = info[x][y].degree;
     if (pitch[x][y] !=  . )
       info[x][y].reset();
     else {
       info[x][y].up = (x - 1 >= 0 && pitch[x - 1][y] ==  . );
       info[x][y].down = (x + 1 < n && pitch[x + 1][y] ==  . );
       info[x][y].left = (y - 1 >= 0 && pitch[x][y - 1] ==  . );
       info[x][y].right = (y + 1 < m && pitch[x][y + 1] ==  . );
       info[x][y].degree = (info[x][y].up + info[x][y].down + info[x][y].left +
                            info[x][y].right);
     }
   }
   return degree != info[x][y].degree;
 }
 void do_push(int x, int y, queue<qcell> &q) {
   if (x >= 0 && x < n && y >= 0 && y < m)
     if (pitch[x][y] ==  . )
       if (info[x][y].degree == 1) q.push(qcell(x, y, 1));
 }
 void occupy(int x, int y, queue<qcell> &q) {
   int xx = x, yy = y;
   char dir =  U ;
   if (info[x][y].down) dir =  D ;
   if (info[x][y].left) dir =  L ;
   if (info[x][y].right) dir =  R ;
   if (dir ==  U ) {
     pitch[x][y] =  v ;
     pitch[x - 1][y] =  ^ ;
     xx = x - 1;
   } else if (dir ==  D ) {
     pitch[x][y] =  ^ ;
     pitch[x + 1][y] =  v ;
     xx = x + 1;
   } else if (dir ==  L ) {
     pitch[x][y] =  > ;
     pitch[x][y - 1] =  < ;
     yy = y - 1;
   } else {
     pitch[x][y] =  < ;
     pitch[x][y + 1] =  > ;
     yy = y + 1;
   }
   update(x, y);
   update(xx, yy);
   if (do_push) {
     if (update(x - 1, y)) do_push(x - 1, y, q);
     if (update(x + 1, y)) do_push(x + 1, y, q);
     if (update(x, y - 1)) do_push(x, y - 1, q);
     if (update(x, y + 1)) do_push(x, y + 1, q);
     if (update(xx - 1, yy)) do_push(xx - 1, yy, q);
     if (update(xx + 1, yy)) do_push(xx + 1, yy, q);
     if (update(xx, yy - 1)) do_push(xx, yy - 1, q);
     if (update(xx, yy + 1)) do_push(xx, yy + 1, q);
   }
   empty_cells -= 2;
 }
 int main() {
   cin >> n >> m;
   for (int i = 0; i < n; i++)
     for (int j = 0; j < m; j++) {
       cin >> pitch[i][j];
       if (pitch[i][j] ==  . ) empty_cells++;
     }
   queue<qcell> q;
   for (int i = 0; i < n; i++)
     for (int j = 0; j < m; j++) {
       update(i, j);
       if (info[i][j].degree == 1) q.push(qcell(i, j, info[i][j].degree));
     }
   bool unique_sol = 1;
   while (1) {
     if (q.empty()) break;
     qcell f = q.front();
     q.pop();
     if (info[f.x][f.y].degree == 0) {
       if (pitch[f.x][f.y] ==  . ) {
         unique_sol = false;
         break;
       }
     } else
       occupy(f.x, f.y, q);
   }
   if (unique_sol)
     if (empty_cells != 0) unique_sol = 0;
   if (!unique_sol)
     cout <<  Not unique  << endl;
   else
     for (int i = 0; i < n; i++) {
       for (int j = 0; j < m; j++) cout << pitch[i][j];
       cout << endl;
     }
   return 0;
 }


func_code_string:
#include <bits/stdc++.h>
 using namespace std;
 const int INF = 0x3f3f3f3f;
 int main() {
   ios::sync_with_stdio(false);
   int t;
   cin >> t;
   while (t--) {
     string s, t;
     cin >> s >> t;
     vector<int> each[26];
     int n, m;
     n = s.length();
     m = t.length();
     for (int i = 0; i < n; ++i) {
       each[s[i] -  a ].push_back(i);
     }
     int las = INF, res = 0;
     for (int i = 0; i < m; ++i) {
       if (upper_bound(each[t[i] -  a ].begin(), each[t[i] -  a ].end(), las) !=
           each[t[i] -  a ].end()) {
         las =
             *upper_bound(each[t[i] -  a ].begin(), each[t[i] -  a ].end(), las);
       } else {
         if (each[t[i] -  a ].empty()) {
           res = -1;
           break;
         } else {
           res++;
           las = each[t[i] -  a ][0];
         }
       }
     }
     cout << res << endl;
   }
   return 0;
 }


func_code_string:
#include <bits/stdc++.h>
 using namespace std;
 int main() {
   int n, h, a, road_width = 0;
   cin >> n >> h;
   for (int i = 0; i < n; i++) {
     cin >> a;
     if (a > h)
       road_width += 2;
     else
       road_width++;
   }
   cout << road_width <<
 ;
   return 0;
 }


func_code_string:
#include <bits/stdc++.h>
 using namespace std;
 int abs(int a, int b) {
   if (a > b)
     return a - b;
   else
     return b - a;
 }
 int main() {
   int n, c, i, b, count = 0, index1 = 1, index2 = 1, flag = 0;
   cin >> n >> c;
   char *s;
   s = new char[n + 2];
   for (i = 1; i <= n; i++) {
     cin >> s[i];
   }
   int *d = new int[n + 1];
   for (i = 1; i <= n / 2; i++) {
     b = abs((int)s[i], (int)s[n - i + 1]);
     if (b < 13)
       d[i] = d[n - i + 1] = b;
     else
       d[i] = d[n - i + 1] = 26 - b;
   }
   if (c > n / 2) c = 1 + n - c;
   for (i = 1; i <= n / 2; i++) {
     if (d[i] > 0) {
       index1 = i;
       break;
     }
   }
   for (i = n / 2; i >= 1; i--) {
     if (d[i] > 0) {
       index2 = i;
       flag = 1;
       break;
     }
   }
   if (c <= index1) {
     count = index2 - c;
   } else if (c <= index2) {
     if (c - index1 > index2 - c)
       count = 2 * (index2 - c) + c - index1;
     else
       count = 2 * (c - index1) + index2 - c;
   } else
     count = c - index1;
   for (i = index1; i <= index2; i++) {
     count += d[i];
   }
   if (flag == 1)
     cout << count;
   else
     cout << 0;
   return 0;
 }


func_code_string:
#include <bits/stdc++.h>
 int any_table[11][11];
 struct DammedPascalNUmber {
   int tb[13][13];
   DammedPascalNUmber() {
     int i, j;
     for (i = 0; i <= 12; i++)
       for (j = 0; j <= i; j++) {
         int &r = tb[i][j];
         if (j == 0 || i == 0)
           r = 1;
         else
           r = tb[i - 1][j - 1] + tb[i - 1][j];
       }
   }
   int count(int n, int m) { return tb[n][m]; }
 } pas;
 int any(int dig, int amo) {
   if (dig < amo) return 0;
   if (amo < 0) return 0;
   if (dig == 0) return 1;
   int &r = any_table[dig][amo];
   int i;
   if (r >= 0) return r;
   r = 1;
   for (i = 0; i < amo; i++) r *= 2;
   for (; i < dig; i++) r *= 8;
   r *= pas.count(dig, amo);
   return r;
 }
 int check(int m, int n) {
   int i, j, t, r = 0;
   for (i = 1; i <= m; i++) {
     char str[15];
     t = 0;
     sprintf(str,  %d , i);
     for (j = 0; str[j]; j++)
       if (str[j] ==  4  || str[j] ==  7 ) t++;
     if (t == n) r++;
   }
   return r;
 }
 int a[13];
 int dfs(int party, int quta) {
   int r = 0, i;
   if (party == 6) {
     return 1;
   }
   for (i = quta; i >= 0; i--)
     if (a[i] > 0) {
       int t = a[i];
       a[i]--;
       r = (1LL * r + 1LL * t * 1LL * dfs(party + 1, quta - i) +
            1LL * 1000000007) %
           1000000007;
       a[i]++;
     }
   return r;
 }
 void test(int n, int m) { printf( any(%d,%d)=%d
 , n, m, any(n, m)); }
 void test2(int m, int n) {
   printf( (%d,%d)=%d a[%d]=%d
 , m, n, check(m, n), n, a[n]);
 }
 int main() {
   memset(any_table, -1, sizeof(any_table));
   int m, s, i, j, k, sn, lucked;
   while (~scanf( %d , &m)) {
     memset(a, 0, sizeof(a));
     char str[15];
     sprintf(str,  %d , m);
     for (sn = 0; str[sn]; sn++)
       ;
     for (j = sn; j > 0; j--) {
       a[j] = 0;
       lucked = 0;
       for (i = 0; i < sn; i++) {
         int p = 0, q = 0;
         k = str[i] -  0  - 1;
         for (; k >= 0; k--)
           if (k == 4 || k == 7)
             q++;
           else
             p++;
         if (p) a[j] += p * any(sn - i - 1, j - lucked);
         if (q) a[j] += q * any(sn - i - 1, j - lucked - 1);
         if (str[i] ==  4  || str[i] ==  7 ) {
           lucked++;
         }
         if (i == sn - 1 && lucked == j) a[j]++;
       }
     }
     a[0] = m;
     for (i = 1; i <= sn; i++) a[0] -= a[i];
     int ans = 0;
     for (i = 1; i <= sn; i++)
       if (a[i]) {
         ans = (1LL * ans + 1LL * a[i] * dfs(0, i - 1) + 1LL * 1000000007) %
               1000000007;
       }
     printf( %d
 , ans);
   }
 }


func_code_string:
#include <bits/stdc++.h>
 using namespace std;
 const int maxn = 1e5 + 10;
 const double pi = acos(-1);
 const int inf = 1 << 30;
 const int mod = 1e9 + 9;
 struct point {
   int x, flag;
   bool operator<(const point &a) const { return flag > a.flag; }
 } s, q;
 bool check(long long a[], int n, long long h, int x) {
   priority_queue<int, vector<int>, less<int> > qwe;
   for (int i = 1; i <= min(n, x); i++) qwe.push(a[i]);
   int f = 1, pos;
   while (!qwe.empty()) {
     pos = qwe.top();
     qwe.pop();
     if (f) h -= pos;
     f ^= 1;
   }
   if (h >= 0ll)
     return true;
   else
     return false;
 }
 int main() {
   int n;
   long long h, a[maxn];
   scanf( %d %lld , &n, &h);
   for (int i = 1; i <= n; i++) scanf( %lld , &a[i]);
   int l = 0, r = n, ans = 0;
   while (l <= r) {
     int mid = (l + r) >> 1;
     if (check(a, n, h, mid))
       l = mid + 1, ans = mid;
     else
       r = mid - 1;
   }
   printf( %d
 , ans);
   return 0;
 }