# A - ><

S = eval(input())

N = len(S)+1

INF = 1000000

ans = [0]*N

tmp = 0

for i in range(N-1):

    if S[i]=='<':

        tmp += 1

    else:

        tmp = 0

    ans[i+1] = tmp

tmp = 0

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

    if S[i]=='>':

        tmp += 1

    else:

        tmp = 0

    ans[i] = max(ans[i],tmp)

print((sum(ans)))
import sys

from collections import deque

from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)

from heapq import heapify, heappop, heappush



sys.setrecursionlimit(10**6)

INF = 10**20



def mint():

    return list(map(int,input().split()))

def lint():

    return list(map(int,input().split()))

def judge(x, l=['Yes', 'No']):

    print((l[0] if x else l[1]))



S = eval(input())

N = len(S)+1

L = [0]*N

R = [0]*N

for i in range(N-1):

    L[i+1] = L[i]+1 if S[i]=='<' else 0

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

    R[i] = R[i+1]+1 if S[i]=='>' else 0

ans = [max(l,r) for l,r in zip(L,R)]

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

import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right  # func(リスト,値)
from heapq import heapify, heappop, heappush

sys.setrecursionlimit(10**6)
INF = 10**20


def mint():
    return list(map(int, input().split()))


def lint():
    return list(map(int, input().split()))


def judge(x, l=["Yes", "No"]):
    print((l[0] if x else l[1]))


S = eval(input())
N = len(S) + 1
L = [0] * N
R = [0] * N
for i in range(N - 1):
    L[i + 1] = L[i] + 1 if S[i] == "<" else 0
for i in range(N - 2, -1, -1):
    R[i] = R[i + 1] + 1 if S[i] == ">" else 0
ans = [max(l, r) for l, r in zip(L, R)]
print((sum(ans)))

-# A - >< +import sys +from collections import deque +from bisect import bisect_left, bisect_right, insort_left, insort_right  # func(リスト,値) +from heapq import heapify, heappop, heappush + +sys.setrecursionlimit(10**6) +INF = 10**20 + + +def mint(): +    return list(map(int, input().split())) + + +def lint(): +    return list(map(int, input().split())) + + +def judge(x, l=["Yes", "No"]): +    print((l[0] if x else l[1])) + + -INF = 1000000 -ans = [0] * N -tmp = 0 +L = [0] * N +R = [0] * N -    if S[i] == "<": -        tmp += 1 -    else: -        tmp = 0 -    ans[i + 1] = tmp -tmp = 0 +    L[i + 1] = L[i] + 1 if S[i] == "<" else 0 -    if S[i] == ">": -        tmp += 1 -    else: -        tmp = 0 -    ans[i] = max(ans[i], tmp) +    R[i] = R[i + 1] + 1 if S[i] == ">" else 0 +ans = [max(l, r) for l, r in zip(L, R)]