def sum_three_deep_dict_values(dicts):
    """Read in two dicts and return a dictionary that contains 
       their outer-joined keys and value sums"""
combined = defaultdict(lambda : defaultdict(lambda : defaultdict(int)))
for layer0 in dicts:
    for k1, layer1 in layer0.items():
        for k2, layer2 in layer1.items():
            for k3, count in layer2.items():
                combined[k1][k2][k3] += count
return combined
Python: суммируйте значения трехуровневых словарей