S = eval(input())

N = len(S)+1

from_left = [0]*N

from_right = [0]*N

ii = [0]*N



for i, s in enumerate(S, 1):

  if s == '>':

    from_left[i] = 0

  else:

    from_left[i] = from_left[i-1]+1

    

for i,s in enumerate(S[::-1]):

  i = N-2-i

  if s == '<':

    from_right[i] = 0

  else:

    from_right[i] = from_right[i+1]+1

    

seq = [max(x,y) for x, y in zip(from_left, from_right)]    

answer = sum(seq)

print(answer)
S = eval(input())

N = len(S)+1

A = [0]*N



for i in range(N-1):

  if S[i] == '<':

    A[i+1] = A[i]+1

    

for i in range(N-2, -1, -1):

  if S[i] == '>':

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

    

print((sum(A)))
S = eval(input())
N = len(S) + 1
from_left = [0] * N
from_right = [0] * N
ii = [0] * N
for i, s in enumerate(S, 1):
    if s == ">":
        from_left[i] = 0
    else:
        from_left[i] = from_left[i - 1] + 1
for i, s in enumerate(S[::-1]):
    i = N - 2 - i
    if s == "<":
        from_right[i] = 0
    else:
        from_right[i] = from_right[i + 1] + 1
seq = [max(x, y) for x, y in zip(from_left, from_right)]
answer = sum(seq)
print(answer)

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

-from_left = [0] * N -from_right = [0] * N -ii = [0] * N -for i, s in enumerate(S, 1): -    if s == ">": -        from_left[i] = 0 -    else: -        from_left[i] = from_left[i - 1] + 1 -for i, s in enumerate(S[::-1]): -    i = N - 2 - i -    if s == "<": -        from_right[i] = 0 -    else: -        from_right[i] = from_right[i + 1] + 1 -seq = [max(x, y) for x, y in zip(from_left, from_right)] -answer = sum(seq) -print(answer) +A = [0] * N +for i in range(N - 1): +    if S[i] == "<": +        A[i + 1] = A[i] + 1 +for i in range(N - 2, -1, -1): +    if S[i] == ">": +        A[i] = max(A[i], A[i + 1] + 1) +print((sum(A)))