def ambitus(pitches: list) -> int:
    """The ambitus or range of a melody in semitones

    >>> ambitus([60, 62, 64, 65, 60])
    5

    Parameters
    ----------
    pitches : list
        List of MIDI pitches

    Returns
    -------
    int
        The ambitus
    """
    return max(pitches) - min(pitches)