def count_pairs(count, rules):
    """Counts the pairs after one round of polymer growth"""
    new_count = dict.fromkeys(rules.keys(), 0)
    for pair, value in count.items():
        if value == 0:
            continue  # No pairs
        new = rules[pair]  # Letter to be inserted
        new_count[(pair[0], new)] += value
        new_count[(new, pair[1])] += value
    return new_count