from typing import Dict
from typing import List
from typing import Set


def same_order(layer_dict: Dict[str, Dict[str, str]], all_orders: List[str]) -> int:
    """
    Check how many distinct orders order some layer dictionary contains.
    :param layer_dict: Layer dictionary
    :param all_orders: All orders in the dictionary
    :return: Amount of distinct orders in layer_dict
    """
    orders: Set[str] = set()
    for order in all_orders:
        state_string: str = ''
        for _, layers in layer_dict.items():
            state_string += layers[order]
        orders.add(state_string)
    return len(orders)