import sys N = int(sys.stdin.readline().rstrip()) numbers = [int(x) for x in sys.stdin.readline().split()] start = 0 ans = 0 while N - start >= 19: correct = True for it in xrange(9): if numbers[it] >= numbers[it + 1]: correct = False for it in xrange(9, 18): if numbers[it] <= numbers[it + 1]: correct = False if correct: ans += 1 start += 1 print ans