from typing import Counter


def multiset_jaccard_index(counter1: Counter, counter2: Counter) -> float:
    """
        Calculates the jaccard index between given two multisets.
        Note that a Counter instance can be used for representing multisets.
    """
    intersection_count: int = sum((counter1 & counter2).values())
    union_count: int = sum((counter1 | counter2).values())
    if not union_count:
        return 0.0
    return intersection_count / union_count