#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,x=0,c=0,b=0,i,j,a[100][100]={0};
cin>>n>>m;
for(i=0;i<n;i++){
for(j=0;j<m;j++){
cin>>a[i][j];
}
}
for(i=0;i<n;i++){
for(j=0;j<m;j++){
c=a[i][j];
b=0;
while(c!=0){
b=b+c%10;
c=c/10;
}
if(b%2!=0){
x++;
}
}
}
cout<<x;
}
/**************************************************************
Problem: 1496
User: chenjiahui
Language: C++
Result: Accepted
Time:7 ms
Memory:2072 kb
****************************************************************/