def checksum(number):
    """Calculate the checksum. A valid number should have a checksum of 1."""
    check = 0
    for n in number:
        check = (2 * check + int(10 if n == 'X' else n)) % 11
    return check