stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<set> 

#include<map> 

#include<stack> 

#include<cmath> 

#include<cstdio> 

#include<queue> 

#include<vector> 

#include<climits> 

#include<cstring> 

#include<iostream> 

#include<algorithm> 

using namespace std; 

#define MAXC 30

#define MAXN 500

#define LL long long 

#define INF INT_MAX 

int read(){ 

    int f=1,x=0; 

    char c=getchar(); 

    while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();} 

    while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();} 

    return f*x; 

}

int c,d[MAXC+5][MAXC+5],cnt[3][MAXC+5],S[3][MAXC+5];

int change(int t,int x){

	int ret=0;

	for(int i=1;i<=c;i++)

		ret+=cnt[t][i]*d[i][x];

	return ret;

}

int main(){

	int n=read(),ans=INF;

	c=read();

	for(int i=1;i<=c;i++)

		for(int j=1;j<=c;j++)

			d[i][j]=read();

	for(int i=1;i<=n;i++)

		for(int j=1;j<=n;j++)

			cnt[(i+j)%3][read()]++;

	for(int t=0;t<=2;t++)

		for(int i=1;i<=c;i++) 

			S[t][i]=change(t,i);

	for(int i=1;i<=c;i++)

		for(int j=1;j<=c;j++)

			for(int k=1;k<=c;k++)

				if(i!=j&&j!=k&&i!=k){

					int tmp=S[0][i]+S[1][j]+S[2][k];

					if(tmp<ans) ans=tmp;

				}

	printf("%d\n",ans);

	return 0;

} 


// Faster C++ solution for the same problem (measured speedup: 5.08403763977554x):
#include<cstdio>

#include<algorithm>

using namespace std;

int d[300+5][300+5];

int t[5][300+5],s[5][300+5];//3的余数为0,1,2——>枚举所有情况求最优值

int x,y,z,ans=(int)1E9;

int n,c;

int solve(int x,int y)

{

	int ret=0;

	for(int i=1;i<=c;i++)

		ret+=t[x][i]*d[i][y];

	return ret;

}

int main()

{

	scanf("%d %d",&n,&c);

	for(int i=1;i<=c;i++)

    	for(int j=1;j<=c;j++)

			scanf("%d",&d[i][j]);//颜色i变成颜色j的代价

	for(int i=1;i<=n;i++)

		for(int j=1;j<=n;j++)

		{

			scanf("%d",&x);

			t[(i+j)%3][x]++;//余数为i,颜色为j的方格个数+1

		}

	for(int i=0;i<=2;i++)

		for(int j=1;j<=c;j++)

			s[i][j]=solve(i,j);

	for(int i=1;i<=c;i++)

		for(int j=1;j<=c;j++)

			for(int k=1;k<=c;k++)

			{

				if(i!=j&&i!=k&&j!=k)

					ans=min(ans,(s[0][i]+s[1][j]+s[2][k]));

			}

	printf("%d\n",ans);

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<vector>

#include<string>

#include<queue>

#include<stack>

#include<set>

#include<cmath>

#include<iomanip>

#include<functional>

using namespace std;



int INF = 1e9 + 7;



typedef long long ll;

typedef pair<int, int> P;



int main() {

	int n, c;

	vector<vector<int>> d(40, vector<int>(40, 0)), e(510, vector<int>(510, 0));

	cin >> n >> c;

	for (int i = 1; i <= c; i++) {

		for (int j = 1; j <= c; j++) {

			cin >> d[i][j];

		}

	}

	vector<int> amari0(31, 0), amari1(31, 0), amari2(31, 0);

	for (int i = 1; i <= n; i++) {

		for (int j = 1; j <= n; j++) {

			cin >> e[i][j];

			if ((i + j) % 3 == 0) amari0[e[i][j]]++;

			if ((i + j) % 3 == 1) amari1[e[i][j]]++;

			if ((i + j) % 3 == 2) amari2[e[i][j]]++;

		}

	}



	int ans = 0, MIN = INF;

	for (int x = 1; x <= c; x++) {

		for (int y = 1; y <= c; y++) {

			for (int z = 1; z <= c; z++) {

				if (x == y || y == z || z == x) continue;



				for (int i = 1; i <= c; i++) {

					ans += amari0[i] * d[i][x];

				}

				for (int i = 1; i <= c; i++) {

					ans += amari1[i] * d[i][y];

				}

				for (int i = 1; i <= c; i++) {

					ans += amari2[i] * d[i][z];

				}



				MIN = min(MIN, ans);

				ans = 0;

			}

		}

	}

	cout << MIN << endl;

}

// Faster C++ solution for the same problem (measured speedup: 3.1116078138136363x):
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<int, int> P;

typedef tuple<int, int, int> T;



int MOD=1e9+7;

ll INF=1e18;



int dx[]={1, -1, 0, 0};

int dy[]={0, 0, 1, -1};



ll mod0cnt[35], mod1cnt[35], mod2cnt[35];

ll d[35][35], g[510][510];



int main(){

    int n, c; cin>>n>>c;

    for(int i=0; i<c; i++){

        for(int j=0; j<c; j++){

            cin>>d[i][j];

        }

    }

    for(int i=0; i<n; i++){

        for(int j=0; j<n; j++){

            cin>>g[i][j];

            if((i+1+j+1)%3==0) mod0cnt[g[i][j]]++;

            else if((i+1+j+1)%3==1) mod1cnt[g[i][j]]++;

            else mod2cnt[g[i][j]]++;

        }

    }



    ll ans=INF;

    for(int i=1; i<=c; i++){

        for(int j=1; j<=c; j++){

            for(int k=1; k<=c; k++){

                if(i==j || k==j || k==i) continue;

                ll sum=0;



                for(int l=1; l<=c; l++){

                    sum+=mod0cnt[l]*d[l-1][i-1];

                    sum+=mod1cnt[l]*d[l-1][j-1];

                    sum+=mod2cnt[l]*d[l-1][k-1];

                }



                ans=min(ans, sum);

            }

        }

    }

    cout << ans << endl;

}
// Slower C++ solution:
#include <cstdio>

#include <map>

#define repi(i,a,b) for(int i=(a);i<(b);++i)

#define rep(i,a) repi(i,0,a)

#define all(a) (a).begin(), (a).end()



int N, C;

int D[30][30];

int c[500][500];

int num[3];

std::map<int, int> cnt[3];



int main()

{

  scanf( "%d%d", &N, &C );

  rep( i, C ) rep( j, C )

    scanf( "%d", &D[i][j] );

  

  rep( i, N ) rep( j, N )

    scanf( "%d", &c[i][j] ), --c[i][j];



  rep( i, N ) rep( j, N )

  {

    int m = (i+j) % 3;



    ++num[m];

    ++cnt[m][c[i][j]];

  }



  int ans = 1<<30;



  rep( i, C ) rep( j, C ) rep( k, C ) if( i != j && j != k && i != k )

  {

    int sum = 0;



    for( auto it = cnt[0].begin(); it != cnt[0].end(); ++it )

      sum += D[it->first][i]*it->second;

    for( auto it = cnt[1].begin(); it != cnt[1].end(); ++it )

      sum += D[it->first][j]*it->second;

    for( auto it = cnt[2].begin(); it != cnt[2].end(); ++it )

      sum += D[it->first][k]*it->second;



    ans = std::min( ans, sum );

  }



  printf( "%d\n", ans );



  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.761536722267899x):
#include <cstdio>

#include <algorithm>

#define repi(i,a,b) for(int i=(a);i<(b);++i)

#define rep(i,a) repi(i,0,a)

#define all(a) (a).begin(), (a).end()



template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



int N, C;

int D[40][40];

int c[510][510];

int diff[5][40];



int main()

{

  scanf( "%d%d", &N, &C );



  rep( i, C ) rep( j, C )

    scanf( "%d", &D[i][j] );



  rep( i, N ) rep( j, N )

    scanf( "%d", &c[i][j] ), --c[i][j];



  rep( col, C )

  {

    rep( i, N ) rep( j, N )

      diff[(i+1+j+1)%3][col] += D[c[i][j]][col];

  }



  int ans = 1<<30;



  rep( col1, C ) rep( col2, C ) rep( col3, C )

  {

    if( !(col1 != col2 && col2 != col3 && col3 != col1) )

      continue;



    ans = std::min( ans, diff[0][col1]+diff[1][col2]+diff[2][col3] );

  }



  printf( "%d\n", ans );



  return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6231171788481995x):
#include <iostream>

#include <cmath>

#include <algorithm>

#include <cstdlib>

using namespace std;

int arr[100000]={0};

int main() {

     int x,y=10000;

     long long a=0,d=0;

     cin>>x;

     int arr[x];

     for(int i=0;i<x;i++){

         cin>>arr[i];

         if (((i+1)%2)==1&& (arr[i]%2)==1)

            a++;

     }

     cout<<a;





    }
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.59143431879533x):
#include<bits/stdc++.h>

#define ll long long

#define endl "\n"

#define pb push_back

#define READ(FILE) freopen(FILE,"r",stdin)

#define WRITE(FILE) freopen(FILE,"w",stdout)

#define loop(i,s,e) for(int i=s;i<e;i++)

#define mego fast();

using namespace std;

void fast()

{

    ios::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

}



ll lcm(ll x, ll y)

{

    return (x*y)/__gcd(x,y);

}

int sum(string s)

{

    int x=0,sz=s.size();

    loop(i,0,sz)x+=(s[i]-'0');

    return x;

}

/*

struct node

{

int data;

node *link;

};

typedef node* nodeptr;

void head_insert(nodeptr& head,int x)

{

    nodeptr tmp;

    tmp=new node;

    tmp->data=x;

    tmp->link=head;

    head=tmp;

}

nodeptr search(nodeptr head,int x)

{

    nodeptr cur=head;

    if(cur ==  nullptr)return cur;

    while(cur->data!=x&&cur->link!=nullptr)

    {

        cur=cur->link;

    }

    if(cur->data==x)return cur;

    else return nullptr;

}

void show(nodeptr head)

{

    nodeptr cur=head;

    if(cur==nullptr)return;

   // cout<<head->data<<" ";

    while(cur->link!=nullptr){

        cout<<cur->data<<" ";

        cur=cur->link;

    }

    cout<<endl;

}

*/



int main()

{

    mego

   int n,ans=0,x;

   cin>>n;

   loop(i,1,n+1)

   {

       cin>>x;

       ans+=((i&1)&&(x&1));

   }

   cout<<ans;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.607774722459984x):
//#include<bits/stdc++.h>

#include<iostream>

#include<iomanip>

#include<string>

#include<cmath>

#include<algorithm>

#include<vector>

#include<stack>

#include<queue>

#include<deque>

#include<set>

#include<map>

#include<bitset>

#define sz(v) (int)v.size()

#define ll long long

#define ull unsigned long long

using namespace std;

const int PI = 3.14159265;

void fast() {

	std::ios_base::sync_with_stdio(0);

	cin.tie(0);cout.tie(0);

}

int main()

{

	//freopen("file.in","r",stdin);

	//freopen("file.out","w",stdout);

	fast();



	int n, p[1001];

	cin >> n;

	int cnt = 0;

	for (int i = 0; i < n; i++)

	{

		cin >> p[i];

		if (i % 2 == 0 && p[i] % 2 == 1) {

			cnt++;

		}

	}

	cout << cnt << '\n';

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.620837319664939x):
#include <iostream>

#include<vector>

#include <cstdlib>

#include<cmath>

#include<string>

#include <iomanip>

#include <sstream>



using namespace std;







int main (){



   int n,i,j,cnt=0;

   cin>>n;



   int a[n];



   for(i=0;i<n;i++){





       cin>>a[i];



}







   for(i=0;i<n;i++){



       if( a[i]%2 == 1 && (i+1)%2 == 1 )

           cnt++;





   }



   cout<<cnt;













}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.615797631651849x):
#include <iostream>



using namespace std;



int main()

{

    int n ,j=1 ,c=0 ;

    cin >> n ;

    int a[n];

    for(int i=0 ; i<n ;i++){

        cin>> a[i] ;

        if(a[i]%2!=0 && j%2!=0)

            c=c+1 ;

        j=j+1 ;



    }

    cout<< c << endl ;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6197039534122952x):
#include <iostream>

using namespace std;

int main(){

    long long n ;

    cin >> n;

    long long c=0;

    long long m;

    for (long long i = 1 ;  i <=n ;i++){

        cin >> m;

        if (i%2==1 && m%2==1){

            c++;

        }

    }

  cout<<c<<endl;

  return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6157949499329463x):
#include <iostream>

using namespace std;

int main()

{

	int count = 0 , k=1 ;

	int z ;

	cin >> z;

	int N[z];

	for (int i = 0; i < z; i++)

	{

		cin >> N[i];

		if (k% 2 != 0 && N[i] % 2 != 0)

		{

			count++;

			

		}

		k++;

	}

	cout << count << endl;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6212776918884826x):
#include <iostream>

using namespace std;

int main(){

    int n;cin>>n;

    int i = 1,sum=0;

    while(i<=n){

        int num;cin>>num;

        if(num%2!=0 && i%2!=0)

            sum++;

        i++;

    }

    cout<<sum;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6209160596046215x):
#include<iostream>

using namespace std;

int main() {

	int N;

	int x=0;

	cin >> N;

	int a[100];

	for (int s = 0; s < N; s++) {

		cin >> a[s];

	}

	for (int i = 1; i <= N; i++) {

		if (a[i-1] % 2 != 0 && i % 2 != 0) {

				x++;

		}

	}

	cout << x;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.5917680979465127x):
#include <bits/stdc++.h>



using namespace std;



void fast();



/*

*

* Watch out! Another Buggy Code From Muhammad_Mamdouh, Happy Coding;

*

*/



int main()

{

    fast();

    int n, square = 0; cin >> n;



    for (int i = 1; i <= n; ++i)

    {

        int x; cin >> x;



        if (i % 2 != 0 && x % 2 != 0)

            ++square;

    }



    cout << square;



    return 0;

}



void fast()

{

    ios_base::sync_with_stdio(0);

    cin.tie(0); cout.tie(0);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.62110566575425x):
#include <iostream>

#include<string.h>

#include<algorithm>

#include<bits/stdc++.h>

using namespace std;





int main()

{

    int t,count=0,x;

    cin>>t;

    for(int i=1;i<=t;i++)

    {

    	cin>>x;

    	if(i%2!=0&&(x)%2!=0)

    	{

    		

    			count++;

    			

			

		}

	}

	cout<<count;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6210861000287387x):
#include <iostream>

#include <set>

#include <string>

#include <vector>



using namespace std;



int main() {

    int n; cin >> n;

    int out = 0, temp = 0;

    for(int i = 1; i <= n; i++) {

        cin >> temp;

        if(i&1 && temp&1)

            out++;

    }

    cout << out;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6217879348763193x):
#include <iostream>



using namespace std;



int main()

{

    int n, c, num;

    cin >> n;

    c = 0;

    for ( int i = 1; i <= n; i = i+2) {

        cin >> num;

        if ( num % 2 == 1) c++;

        if ( i != n) cin >> num;

    }

    cout << c;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6179344224060133x):
#include <iostream>

using namespace std;



int main() {

int n, arr[100], count=0;

cin>>n;

for(int i = 1; i <= n; i++){

    cin>>arr[i];

    if(arr[i] % 2 == 1 && i % 2 == 1)

        count +=1;

}

cout<<count<<endl;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.617137685636069x):
#include <iostream>



using namespace std;



int main()

{

    int n,x,cnt=0;

    cin>>n;

    for(int i=1;i<=n;i++){

        cin>>x;

        if(i%2==1&&x%2==1)cnt++;

    }

    cout <<cnt << endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.621227357768489x):
#include <iostream>



using namespace std;



int main()

{

    int n, c=0;



    cin>>n;



    int a[n];

    for(int i=1; i<=n; i++){

        cin>>a[i];

    }

    for(int j=1; j<=n; j++){

        if(j%2 != 0 && a[j]%2 != 0){

            c++;

        }

    }

    cout<<c;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define oo (long long)1e18

#define ll long long

#define setdp memset(dp,-1,sizeof(dp))

const ll mod = 1e9+7;

void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}

#define PI 3.14159265359

int n,l,r,x;

    vector<int>b(200009),a(200009);

int main()

{

    cin>>n;

    int ans=0;

    for(int i=1;i<=n;i++)

    {

        cin>>a[i];

        if(i&1&&a[i]&1)

            ans++;

    }

    cout<<ans;

}


// Faster C++ solution for the same problem (measured speedup: 2.6212006638481293x):


#include <bits/stdc++.h>

using namespace std;

int square[100];



int main() {

    int n, sol{ 0 };

    cin >> n;

    for (int i{ 1 }; i <= n; i++) {

        cin >> square[i];

    }



    for (int i{ 1 }; i <= n; i++) {

        if (i % 2 != 0 && square[i] % 2 != 0)sol++;

    }



    cout << sol;

    

    return 0;

}