def find_header(path: str) -> int:
    """find_header
    this function counts the lines of the header (i.e. how many lines there are
    until the first line with doesn't start with a '#' is encountered)

    Parameters
    ----------
    path : str
        file path

    Returns
    -------
    int
        number of lines belonging to the header
    """
    comment_lines = -1
    with open(path, "r") as file:
        for line in file.readlines():
            if (line.strip().startswith("#")):
                comment_lines += 1
                continue
            else:
                break
        if (comment_lines == -1):
            return 0
    return comment_lines