import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



S = readline().rstrip().decode('utf-8')



N = len(S)+1



from_left = [0]*N

from_right = [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 = [x if x>y else y for x,y in zip(from_left,from_right)]



answer = sum(seq)

print(answer)
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



S = read().rstrip().decode('utf-8')



S = S.replace('><','>,<').split(',')



answer = 0

for T in S:

    # <<<< >>>> の形

    a = T.count('<')

    b = T.count('>')

    x = a * (a-1) // 2 + b * (b-1) // 2 + max(a,b)

    answer += x



print(answer)
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
S = readline().rstrip().decode("utf-8")
N = len(S) + 1
from_left = [0] * N
from_right = [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 = [x if x > y else y for x, y in zip(from_left, from_right)]
answer = sum(seq)
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
S = read().rstrip().decode("utf-8")
S = S.replace("><", ">,<").split(",")
answer = 0
for T in S:
    # <<<< >>>> の形
    a = T.count("<")
    b = T.count(">")
    x = a * (a - 1) // 2 + b * (b - 1) // 2 + max(a, b)
    answer += x
print(answer)

-S = readline().rstrip().decode("utf-8") -N = len(S) + 1 -from_left = [0] * N -from_right = [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 = [x if x > y else y for x, y in zip(from_left, from_right)] -answer = sum(seq) +S = read().rstrip().decode("utf-8") +S = S.replace("><", ">,<").split(",") +answer = 0 +for T in S: +    # <<<< >>>> の形 +    a = T.count("<") +    b = T.count(">") +    x = a * (a - 1) // 2 + b * (b - 1) // 2 + max(a, b) +    answer += x