def part1(tree_line):
    """ Count the number of trees encountered """
    height = len(tree_line)
    width = len(tree_line[0])
    x_coord, y_coord, tree_count = 0, 1, 0

    for line in tree_line[1:height:y_coord]:
        x_coord = (x_coord + 3) % width
        if line[x_coord] == "#":
            tree_count += 1
    return tree_count