def part_one(array, over, down):
    """Returns the number of trees encountered in the given array at the given slope"""
    trees = 0
    col = 0
    for line in array[down::down]:
        col += over
        if col >= len(line):
            col -= len(line)
        if line[col] == '#':
            trees += 1
    return trees