def traverse_map(input_map, right=3, down=1):
    """Travel down the input map by heading right and down a fixed amount each
    iteration.
    The map consists of clear ground '.', and trees '#'.
    The map repeats to the right infinitely.
    Get the number of trees that would be encountered travelling from the top
    left at the specified slope.

    :param input_map: A list of lines consisting of '.'s and '#'s.
    :param right: The number of grid spaces to move right each iteration
    :param down: The number of grid spaces to move down each iteration
    :return: int
    """
    tree_count = 0
    x_axis = 0
    for line in input_map[::down]:
        if line[x_axis % len(line)] == "#":
            tree_count += 1
        x_axis += right
    return tree_count