from itertools import*

s=eval(input())

x=[[k,len(list(v))]for k,v in groupby(s)]



ans=0

#print(x)

for i in range(len(x)):

    try:

        if x[i][0]=="<" and x[i+1][0]==">":

            n=max(x[i][1],x[i+1][1])

            m=min(x[i][1],x[i+1][1])

            ans+=(n+1)*n//2+(m-1)*m//2

    except:

        break



if x[0][0]==">":

    y=x[0][1]

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

if x[-1][0]=="<":

    y=x[-1][1]

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



print(ans)

from itertools import*

r=p=0

for k,g in groupby(eval(input())):

    x=len(list(g))

    r+=x*(x+1)//2

    r-=min(x,p)*(k=='>')

    p=x

print(r)
from itertools import *

s = eval(input())
x = [[k, len(list(v))] for k, v in groupby(s)]
ans = 0
# print(x)
for i in range(len(x)):
    try:
        if x[i][0] == "<" and x[i + 1][0] == ">":
            n = max(x[i][1], x[i + 1][1])
            m = min(x[i][1], x[i + 1][1])
            ans += (n + 1) * n // 2 + (m - 1) * m // 2
    except:
        break
if x[0][0] == ">":
    y = x[0][1]
    ans += y * (y + 1) // 2
if x[-1][0] == "<":
    y = x[-1][1]
    ans += y * (y + 1) // 2
print(ans)

from itertools import *

r = p = 0
for k, g in groupby(eval(input())):
    x = len(list(g))
    r += x * (x + 1) // 2
    r -= min(x, p) * (k == ">")
    p = x
print(r)

-s = eval(input()) -x = [[k, len(list(v))] for k, v in groupby(s)] -ans = 0 -# print(x) -for i in range(len(x)): -    try: -        if x[i][0] == "<" and x[i + 1][0] == ">": -            n = max(x[i][1], x[i + 1][1]) -            m = min(x[i][1], x[i + 1][1]) -            ans += (n + 1) * n // 2 + (m - 1) * m // 2 -    except: -        break -if x[0][0] == ">": -    y = x[0][1] -    ans += y * (y + 1) // 2 -if x[-1][0] == "<": -    y = x[-1][1] -    ans += y * (y + 1) // 2 -print(ans) +r = p = 0 +for k, g in groupby(eval(input())): +    x = len(list(g)) +    r += x * (x + 1) // 2 +    r -= min(x, p) * (k == ">") +    p = x +print(r)