from typing import Counter


def flatten(counter):
   """
   takes a dictionary of dictionaries and flattens it into a new
   counter with keys of the form <key1.key2>
   """
   flatCounter = Counter()
   for key1 in counter.keys():
       for key2 in counter[key1].keys():
           newKey = key1 + '.' + key2
           flatCounter[newKey] = counter[key1][key2]
   return flatCounter