def renketu(base,a,b):

    if base == 1:

        b.reverse()

    max_ = max(a[-1],b[0])

    a.pop(-1)

    b[0] = max_

    a.extend(b)

    return a,b

    

s = [*eval(input())]

if len(s) == 1:

    print((1))

    exit()

hugo = ["<", ">"]

a = [0]

b = []

base = -1

for i in range(len(s) - 1):

    if base == -1: #一番最初

        base = hugo.index(s[i])

        b = [0,1]

    elif base != hugo.index(s[i]): #符号が切り替わった時

        #前グループの処理

        a,b = renketu(base,a,b)

        #新しい処理

        b = [0,1]

        base = hugo.index(s[i])

    else: #同じ符号が続いてる時

        b.append(b[-1] + 1) 

if hugo.index(s[-1]) == base: #一番ラストの符号

    b.append(b[-1] + 1)

    a,b = renketu(base,a,b)

else:

    #前グループの処理

    a,b = renketu(base,a,b)

    #今回の処理

    if hugo.index(s[-1]) == 1:

        b = [1,0]

    else:

        b = [0,1]

    max_ = max(a[-1],b[0])

    b[0] = max_

    a.pop(-1)

    a.extend(b)

    

print((sum(a)))

    
s = eval(input())

a = [0] * (len(s) + 1)

for i in range(len(s)):

    if s[i] == '<':

        a[i+1] = a[i] + 1

    

for i in range(len(s))[::-1]:

    if s[i] == '>':

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

print((sum(a)))      
def renketu(base, a, b):
    if base == 1:
        b.reverse()
    max_ = max(a[-1], b[0])
    a.pop(-1)
    b[0] = max_
    a.extend(b)
    return a, b


s = [*eval(input())]
if len(s) == 1:
    print((1))
    exit()
hugo = ["<", ">"]
a = [0]
b = []
base = -1
for i in range(len(s) - 1):
    if base == -1:  # 一番最初
        base = hugo.index(s[i])
        b = [0, 1]
    elif base != hugo.index(s[i]):  # 符号が切り替わった時
        # 前グループの処理
        a, b = renketu(base, a, b)
        # 新しい処理
        b = [0, 1]
        base = hugo.index(s[i])
    else:  # 同じ符号が続いてる時
        b.append(b[-1] + 1)
if hugo.index(s[-1]) == base:  # 一番ラストの符号
    b.append(b[-1] + 1)
    a, b = renketu(base, a, b)
else:
    # 前グループの処理
    a, b = renketu(base, a, b)
    # 今回の処理
    if hugo.index(s[-1]) == 1:
        b = [1, 0]
    else:
        b = [0, 1]
    max_ = max(a[-1], b[0])
    b[0] = max_
    a.pop(-1)
    a.extend(b)
print((sum(a)))

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

-def renketu(base, a, b): -    if base == 1: -        b.reverse() -    max_ = max(a[-1], b[0]) -    a.pop(-1) -    b[0] = max_ -    a.extend(b) -    return a, b - - -s = [*eval(input())] -if len(s) == 1: -    print((1)) -    exit() -hugo = ["<", ">"] -a = [0] -b = [] -base = -1 -for i in range(len(s) - 1): -    if base == -1:  # 一番最初 -        base = hugo.index(s[i]) -        b = [0, 1] -    elif base != hugo.index(s[i]):  # 符号が切り替わった時 -        # 前グループの処理 -        a, b = renketu(base, a, b) -        # 新しい処理 -        b = [0, 1] -        base = hugo.index(s[i]) -    else:  # 同じ符号が続いてる時 -        b.append(b[-1] + 1) -if hugo.index(s[-1]) == base:  # 一番ラストの符号 -    b.append(b[-1] + 1) -    a, b = renketu(base, a, b) -else: -    # 前グループの処理 -    a, b = renketu(base, a, b) -    # 今回の処理 -    if hugo.index(s[-1]) == 1: -        b = [1, 0] -    else: -        b = [0, 1] -    max_ = max(a[-1], b[0]) -    b[0] = max_ -    a.pop(-1) -    a.extend(b) +s = eval(input()) +a = [0] * (len(s) + 1) +for i in range(len(s)): +    if s[i] == "<": +        a[i + 1] = a[i] + 1 +for i in range(len(s))[::-1]: +    if s[i] == ">": +        a[i] = max(a[i + 1] + 1, a[i])