from numpy import* M=loadtxt(open(0),"q",skiprows=1) print(max(sum(sum([M,M.T],1)%2,0)))