int steps: the number of steps on the hike
string path: a string describing the path
int: the number of valleys traversed
def countingValleys(steps, path):
# Write your code here
result = 0
pos = 0
for i in range(steps):
if path[i] == 'U':
pos +=1
else:
if pos==0:
result +=1
pos -=1
return result