# import sys

#

# sys.setrecursionlimit(10 ** 7)

#

# input = sys.stdin.readline

# rstrip()



# int(input())

# map(int, input().split())



def solve(s):

    n = len(s)

    t = [-1] * n



    if s[0] == '<':

        t[0] = 0

    if s[-1] == '>':

        t[-1] == 0



    for ind, (prev, after) in enumerate(zip(s, s[1:])):

        if prev + after == '><':

            t[ind + 1] = 0

    ku = 0

    hu = 0

    ans = 0

    for ind, c in enumerate(s):

        if t[ind] == 0:

            max_ = max(ku, hu)

            min_ = min(ku, hu)

            ans += (max_ + 1) * max_ // 2

            ans += (min_ - 1) * min_ // 2

            ku = 0

            hu = 0

        if c == '<':

            ku += 1

        else:

            hu += 1

    max_ = max(ku, hu)

    min_ = min(ku, hu)

    ans += (max_ + 1) * max_ // 2

    ans += (min_ - 1) * min_ // 2

    return ans





if __name__ == '__main__':

    s = eval(input())

    print((solve(s)))

s = eval(input())

n = len(s)



a = [0] * (n + 1)



for i in range(n):

    if s[i] == '<':

        a[i + 1] = max(a[i + 1], a[i] + 1)



for i in range(n - 1, -1, -1):

    if s[i] == '>':

        a[i] = max(a[i], a[i + 1] + 1)



print((sum(a)))

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())
def solve(s):
    n = len(s)
    t = [-1] * n
    if s[0] == "<":
        t[0] = 0
    if s[-1] == ">":
        t[-1] == 0
    for ind, (prev, after) in enumerate(zip(s, s[1:])):
        if prev + after == "><":
            t[ind + 1] = 0
    ku = 0
    hu = 0
    ans = 0
    for ind, c in enumerate(s):
        if t[ind] == 0:
            max_ = max(ku, hu)
            min_ = min(ku, hu)
            ans += (max_ + 1) * max_ // 2
            ans += (min_ - 1) * min_ // 2
            ku = 0
            hu = 0
        if c == "<":
            ku += 1
        else:
            hu += 1
    max_ = max(ku, hu)
    min_ = min(ku, hu)
    ans += (max_ + 1) * max_ // 2
    ans += (min_ - 1) * min_ // 2
    return ans


if __name__ == "__main__":
    s = eval(input())
    print((solve(s)))

s = eval(input())
n = len(s)
a = [0] * (n + 1)
for i in range(n):
    if s[i] == "<":
        a[i + 1] = max(a[i + 1], a[i] + 1)
for i in range(n - 1, -1, -1):
    if s[i] == ">":
        a[i] = max(a[i], a[i + 1] + 1)
print((sum(a)))

-# import sys -# -# sys.setrecursionlimit(10 ** 7) -# -# input = sys.stdin.readline -# rstrip() -# int(input()) -# map(int, input().split()) -def solve(s): -    n = len(s) -    t = [-1] * n -    if s[0] == "<": -        t[0] = 0 -    if s[-1] == ">": -        t[-1] == 0 -    for ind, (prev, after) in enumerate(zip(s, s[1:])): -        if prev + after == "><": -            t[ind + 1] = 0 -    ku = 0 -    hu = 0 -    ans = 0 -    for ind, c in enumerate(s): -        if t[ind] == 0: -            max_ = max(ku, hu) -            min_ = min(ku, hu) -            ans += (max_ + 1) * max_ // 2 -            ans += (min_ - 1) * min_ // 2 -            ku = 0 -            hu = 0 -        if c == "<": -            ku += 1 -        else: -            hu += 1 -    max_ = max(ku, hu) -    min_ = min(ku, hu) -    ans += (max_ + 1) * max_ // 2 -    ans += (min_ - 1) * min_ // 2 -    return ans - - -if __name__ == "__main__": -    s = eval(input()) -    print((solve(s))) +s = eval(input()) +n = len(s) +a = [0] * (n + 1) +for i in range(n): +    if s[i] == "<": +        a[i + 1] = max(a[i + 1], a[i] + 1) +for i in range(n - 1, -1, -1): +    if s[i] == ">": +        a[i] = max(a[i], a[i + 1] + 1) +print((sum(a)))