import json


def states_data_json(request):
    """Send the count of the number of states in each complexity."""
    with open('electric_slide/data/state_almanac_data.json') as f:
        all_states = json.load(f)
    all_val = list(all_states.values())
    return {c: all_val.count(c) for c in range(max(all_val) + 1)}