from itertools import groupby, chain, islice

 

def pairs(t):

    a = True

    while a:

        a =[sum(1 for _ in g) for k, g in islice(t, 2)]

        if a:

            yield sum(x * (x - 1) // 2 for x in a) + max(a)

 

s = eval(input())

t = groupby(s)

if s[0] == '>':

    t = chain([(0, ())], t)

print((sum(pairs(t))))

from itertools import groupby



s = eval(input())

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

    s += '>' 

r = p = 0

for k, g in groupby(s):

    s = sum(1 for _ in g)

    if k == '>':

        r += (p * p  + s * s - p - s) // 2 + max(p, s)

    p = s

print(r)

from itertools import groupby, chain, islice


def pairs(t):
    a = True
    while a:
        a = [sum(1 for _ in g) for k, g in islice(t, 2)]
        if a:
            yield sum(x * (x - 1) // 2 for x in a) + max(a)


s = eval(input())
t = groupby(s)
if s[0] == ">":
    t = chain([(0, ())], t)
print((sum(pairs(t))))

from itertools import groupby

s = eval(input())
if s[-1] == "<":
    s += ">"
r = p = 0
for k, g in groupby(s):
    s = sum(1 for _ in g)
    if k == ">":
        r += (p * p + s * s - p - s) // 2 + max(p, s)
    p = s
print(r)

-from itertools import groupby, chain, islice - - -def pairs(t): -    a = True -    while a: -        a = [sum(1 for _ in g) for k, g in islice(t, 2)] -        if a: -            yield sum(x * (x - 1) // 2 for x in a) + max(a) - +from itertools import groupby -t = groupby(s) -if s[0] == ">": -    t = chain([(0, ())], t) -print((sum(pairs(t)))) +if s[-1] == "<": +    s += ">" +r = p = 0 +for k, g in groupby(s): +    s = sum(1 for _ in g) +    if k == ">": +        r += (p * p + s * s - p - s) // 2 + max(p, s) +    p = s +print(r)