Problem 1003 There can be many high mountain lines?

aleir | 2015-08-08 19:15:22Author
If the heights are 1 2 2 2 1 3 3 3 0 the answer is 6?
admin | 2015-08-08 19:16:20# 1
yes
yes