import collections


def get_checksum(fn: str) -> int:
    """Opens file and counts number of lines that contain:
    - Exactly two of a character
    - Exactly three of a character

    returns 'checksum' by multiplying both counts
    """
    with open(fn) as f:
        two = 0
        three = 0
        for item in f:
            counts = set(collections.Counter(item).values())
            two += 2 in counts
            three += 3 in counts
        return two*three