def calculate_collisions(toboggan_map, step_x, step_y):
    """ Calculate amount of collisions with trees """
    count = 0
    posx = step_x
    for line in toboggan_map[1:]:
        if toboggan_map.index(line) % step_y == 0:
            if line[posx % len(line)] == "#":
                count += 1
            posx += step_x
    return count