Find hamming distance