-= Puzzle 4: Magic Flowerstalk =-
As you clock in for your fourth day at BitFlop Laboratories, you're assigned to help the botany department.
Their latest creation is called the Magic Flowerstalk.
This type of flower is like a sunflower, except it grows way larger than the average sunflower.
Naturally, nobody thought about how anyone was supposed to harvest it.
For example, here's a young Magic Flowerstalk that is 19 meters tall (not including the soil):
\|/
-@-
/|\
|-o
o-|
o-|
|-o
|
o-|
|-o
|-o
o-|
o-|
|
o-|
o-|
|
o-|
|-o
#####
This flower consists of:
- A ground layer, represented by
#####. - A stem that is 16 blocks tall.
- A flower head that is 3 blocks tall.
Each stem block may contain a leaf, shown as either o-| (left side) or |-o (right side).
To harvest the leaves, workers cut the stem at a specific height and collect every leaf attached to the stem above the cut.
For example, cutting the flower at height 8 produces the following:
\|/
-@-
/|\
|-o
o-|
o-|
|-o
|
o-|
|-o
|-o
o-| < CUT
o-|
|
o-|
o-|
|
o-|
|-o
#####
A cut at height 8 means the cut is made 8 stem blocks above the ground layer.
The workers end up collecting the leaves that are above this cut, which are |-o, |-o, o-|, |-o, o-|, o-| and |-o, which is 7 leaves in total.
Your puzzle input contains a much larger and mature Magic Flowerstalk, represented by the exact same format.
Due to the size of the flower, the workers have to cut the flower higher then a height of 8 like in the example, instead they will cut the flower at a height of 400.
How many leaves will the workers collect if they cut the stem of the flower at height 400?