@staticmethod
def c():
    (n, *a) = map(int, sys.stdin.read().split())
    a += [(- 1)]
    cnt = n
    tmp = 1
    for i in range(n):
        if (a[(i + 1)] > a[i]):
            tmp += 1
        else:
            cnt += ((tmp * (tmp - 1)) // 2)
            tmp = 1
    print(cnt)
@staticmethod
def c():
    (n, *a) = map(int, sys.stdin.read().split())
    a += [(- 1)]
    cnt = n
    tmp = 1
    for i in range(n):
        if (a[(i + 1)] > a[i]):
            tmp += 1
        else:
            cnt += ((tmp * (tmp - 1)) // 2)
            tmp = 1
    print(cnt)