S = eval(input())

s = len(S)

A = [0]*(s+1)



for i in range(s):

  if S[i] == '<':

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

    

for j in range(s-1,-1,-1):

  if S[j] == '>':

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

    

print((sum(A)))

  
import sys



sys.setrecursionlimit(10**7)

def I(): return int(sys.stdin.readline().rstrip())

def MI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし

def S(): return sys.stdin.readline().rstrip()

def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり

def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし





S = LS2()

N = len(S)+1



ANS = [0]*N

for i in range(N-1):

    if S[i] == '<':

        ANS[i+1] = ANS[i]+1



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

    if S[i] == '>':

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



print((sum(ANS)))

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

import sys

sys.setrecursionlimit(10**7)


def I():
    return int(sys.stdin.readline().rstrip())


def MI():
    return list(map(int, sys.stdin.readline().rstrip().split()))


def LI():
    return list(map(int, sys.stdin.readline().rstrip().split()))  # 空白あり


def LI2():
    return list(map(int, sys.stdin.readline().rstrip()))  # 空白なし


def S():
    return sys.stdin.readline().rstrip()


def LS():
    return list(sys.stdin.readline().rstrip().split())  # 空白あり


def LS2():
    return list(sys.stdin.readline().rstrip())  # 空白なし


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

-S = eval(input()) -s = len(S) -A = [0] * (s + 1) -for i in range(s): +import sys + +sys.setrecursionlimit(10**7) + + +def I(): +    return int(sys.stdin.readline().rstrip()) + + +def MI(): +    return list(map(int, sys.stdin.readline().rstrip().split())) + + +def LI(): +    return list(map(int, sys.stdin.readline().rstrip().split()))  # 空白あり + + +def LI2(): +    return list(map(int, sys.stdin.readline().rstrip()))  # 空白なし + + +def S(): +    return sys.stdin.readline().rstrip() + + +def LS(): +    return list(sys.stdin.readline().rstrip().split())  # 空白あり + + +def LS2(): +    return list(sys.stdin.readline().rstrip())  # 空白なし + + +S = LS2() +N = len(S) + 1 +ANS = [0] * N +for i in range(N - 1): -        A[i + 1] = A[i] + 1 -for j in range(s - 1, -1, -1): -    if S[j] == ">": -        A[j] = max(A[j], A[j + 1] + 1) -print((sum(A))) +        ANS[i + 1] = ANS[i] + 1 +for i in range(N - 2, -1, -1): +    if S[i] == ">": +        ANS[i] = max(ANS[i], ANS[i + 1] + 1) +print((sum(ANS)))