Compute zeroth homology