def count_trees(area, dx, dy):
    """Count the trees along a given slope"""
    trees = 0
    y = 0
    x = 0
    max_x = len(area[0])
    max_y = len(area)
    while y < max_y-dy:
        y += dy
        x += dx
        pos = area[y][x % max_x]
        if pos == "#":
            trees += 1
    print(f"Encountered {trees} trees using this slope")
    return trees