from typing import Tuple


def interval_overlap(a: Tuple[int, int], b: Tuple[int, int]) -> int:
    """
    Calculate the overlap between two intervals
    Example: a=(10, 30) and b=(20, 40) gives an overlap of 10
    """
    return max(0, min(a[1], b[1]) - max(a[0], b[0]))