def hamming(s1, s2):
    """Count the number of differing bits between two strings"""
    total = 0
    for c1, c2 in zip(s1, s2):
        total += sum(((ord(c1)^ord(c2)) >> i) & 1 for i in range(8))
    return total