#from statistics import median

import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

#from fractions import gcd

#from itertools import combinations # (string,3) 3回

#from collections import deque

#from collections import deque,defaultdict

#import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7

#mod = 9982443453

def readInts():

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

def I():

  return int(eval(input()))



S = eval(input())

ln = len(S)

ans = [0] * (ln+1)

# 前から

for i in range(ln):

    if S[i] == '<':

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

#print(ans)

# 後ろから

for i in range(ln-1,-1,-1):

    if S[i] == '>':

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

#print(ans)

print((sum(ans)))

#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from math import gcd

from itertools import combinations,permutations,accumulate, product # (string,3) 3回

#from collections import deque

from collections import deque,defaultdict,Counter

import decimal

import re

import math

import bisect

import heapq

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#

# my_round_int = lambda x:np.round((x*2 + 1)//2)

# 四捨五入g

#

# インデックス系

# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);

# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);

#

#

import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7

#mod = 9982443453

#mod = 998244353

INF = float('inf')

from sys import stdin

readline = stdin.readline

def readInts():

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

def readTuples():

    return tuple(map(int,readline().split()))

def I():

    return int(readline())

S = eval(input())

n = len(S)

lis = [0] * (len(S)+1)

for i in range(n):

    if S[i] == '<':

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

for i in range(n-1,-1,-1):

    if S[i] == '>':

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

print((sum(lis)))

# from statistics import median
import collections

# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
# from fractions import gcd
# from itertools import combinations # (string,3) 3回
# from collections import deque
# from collections import deque,defaultdict
# import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
def readInts():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


S = eval(input())
ln = len(S)
ans = [0] * (ln + 1)
# 前から
for i in range(ln):
    if S[i] == "<":
        ans[i + 1] = max(ans[i + 1], ans[i] + 1)
# print(ans)
# 後ろから
for i in range(ln - 1, -1, -1):
    if S[i] == ">":
        ans[i] = max(ans[i], ans[i + 1] + 1)
# print(ans)
print((sum(ans)))

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations, permutations, accumulate, product  # (string,3) 3回

# from collections import deque
from collections import deque, defaultdict, Counter
import decimal
import re
import math
import bisect
import heapq

#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
# mod = 998244353
INF = float("inf")
from sys import stdin

readline = stdin.readline


def readInts():
    return list(map(int, readline().split()))


def readTuples():
    return tuple(map(int, readline().split()))


def I():
    return int(readline())


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

-import collections +# import collections +# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] +from math import gcd +from itertools import combinations, permutations, accumulate, product  # (string,3) 3回 -# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] -# from fractions import gcd -# from itertools import combinations # (string,3) 3回 -# from collections import deque,defaultdict -# import bisect -# -#    d = m - k[i] - k[j] -#    if kk[bisect.bisect_right(kk,d) - 1] == d: +from collections import deque, defaultdict, Counter +import decimal +import re +import math +import bisect +import heapq + +# +# +# my_round_int = lambda x:np.round((x*2 + 1)//2) +# 四捨五入g +# +# インデックス系 +# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2); +# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2); +# mod = 998244353 +INF = float("inf") +from sys import stdin + +readline = stdin.readline + + -    return list(map(int, input().split())) +    return list(map(int, readline().split())) + + +def readTuples(): +    return tuple(map(int, readline().split())) -    return int(eval(input())) +    return int(readline()) -ln = len(S) -ans = [0] * (ln + 1) -# 前から -for i in range(ln): +n = len(S) +lis = [0] * (len(S) + 1) +for i in range(n): -        ans[i + 1] = max(ans[i + 1], ans[i] + 1) -# print(ans) -# 後ろから -for i in range(ln - 1, -1, -1): +        lis[i + 1] = max(lis[i + 1], lis[i] + 1) +for i in range(n - 1, -1, -1): -        ans[i] = max(ans[i], ans[i + 1] + 1) -# print(ans) -print((sum(ans))) +        lis[i] = max(lis[i], lis[i + 1] + 1) +print((sum(lis)))