def count_trees(map: list, start: tuple, vector: tuple) -> int:
    """
    Count the number of '#' trees encountered by following 
    the movement of vector until reach the last line.
    """
    x, y = start
    count = 0
    width = len(map[0])
    while y < len(map)-1:
        x += vector[0]
        y += vector[1]
        if x >= width:
            x -= width
        if map[y][x] == '#':
            count += 1
    return count