from typing import List
from typing import Dict
from typing import Any


def _identify_trial_index_starting_step(
    index: int,
    trial_list: List[List[Dict[str, Any]]]
) -> int:
    """Return the MCS step at the start of the trial with the given
    index."""
    step = 0
    for prior_index in range(0, index):
        # Add 1 for the EndHabituation action step at the end of the trial.
        step += len(trial_list[prior_index]) + 1
    return step