Counting Valleys