def count_commands(commands):
    """
    Count the number of actual commands from a list of commands that may contain
    "macro" commands

    Args:
        commands (list): List of commands

    Returns:
        int: The true number of commands
    """
    sv_commands = [
        "delay",
        "wait",
        "signal",
        "end",
        "timestamp",
        "display",
        "flag",
    ]

    count = 0
    for command in commands:
        for sv_command in sv_commands:
            if sv_command in command:
                count += 1
                break
            if "interface" in command:
                count += len(command["interface"]["payload"])
                break
            if "macro" in command and command["macro"] == "INIT_SIGNALS":
                count += len(command["commands"])
                break
            if "macro" in command and command["macro"] == "END":
                count += 1
                break
    return count