def coverage(reference: str, target: str) -> int:
    """
    The number of substitutions in an alignment.

    >>> coverage("---ATGGC", "GTTA-GGG")
    4
    """
    return sum([ref != "-" and tgt != "-" for ref, tgt in zip(reference, target)])