#! /usr/bin/env python

# -*- coding: utf-8 -*-

# vim:fenc=utf-8

#



"""

GC040 A

"""



ali = list(eval(input()))



zeroflag = False

lastflag = False



if ali[0] == '<':

    ali.insert(0, '>')

    zeroflag = True

if ali[-1] == '>':

    ali.append('<')

    lastflag = True



itop = []

ibtm = []

# print(ali)



for (i, x) in enumerate(ali[:-1]):

    # print(i)

    if x == '>' and ali[i+1] == '<':

        ibtm.append(i+1)

    if x == '<' and ali[i+1] == '>':

        itop.append(i+1)

itop.append(len(ali))



# print(itop)

# print(ibtm)



s = 0

nowtop = 0

toplheight = [-10]

toprheight = []



for l in range(len(itop)):

    nexttop = itop[l]

    nowbtm = ibtm[l]

    lint = nowbtm - nowtop - 1

    rint = nexttop - nowbtm - 1

    s += (lint)*(lint+1)//2

    s += (rint)*(rint+1)//2

    toprheight.append(lint)

    toplheight.append(rint)

    # print('l',l)

    # print('s',s)

    nowtop = nexttop



toprheight.append(-10)



if zeroflag:

    del toplheight[0]

    del toprheight[0]

if lastflag:

    toplheight.pop()

    toprheight.pop()



while toplheight:

    left = toplheight.pop()

    right = toprheight.pop()

    s += max(left, right)+1



print(s)



#! /usr/bin/env python

# -*- coding: utf-8 -*-

# vim:fenc=utf-8

#



"""

GC040 A-2

"""



ali = list(eval(input()))



tmp = 0

b = [0]

for L in ali:

    if L == '<':

        tmp += 1

    else:

        tmp = 0

    b.append(tmp)



tmp = 0

c = [0]

ali.reverse()

for L in ali:

    if L == '>':

        tmp += 1

    else:

        tmp = 0

    c.append(tmp)

c.reverse()



numlist = [max(a, b) for (a, b) in zip(b, c)]

print((sum(numlist)))

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
"""
GC040 A
"""
ali = list(eval(input()))
zeroflag = False
lastflag = False
if ali[0] == "<":
    ali.insert(0, ">")
    zeroflag = True
if ali[-1] == ">":
    ali.append("<")
    lastflag = True
itop = []
ibtm = []
# print(ali)
for (i, x) in enumerate(ali[:-1]):
    # print(i)
    if x == ">" and ali[i + 1] == "<":
        ibtm.append(i + 1)
    if x == "<" and ali[i + 1] == ">":
        itop.append(i + 1)
itop.append(len(ali))
# print(itop)
# print(ibtm)
s = 0
nowtop = 0
toplheight = [-10]
toprheight = []
for l in range(len(itop)):
    nexttop = itop[l]
    nowbtm = ibtm[l]
    lint = nowbtm - nowtop - 1
    rint = nexttop - nowbtm - 1
    s += (lint) * (lint + 1) // 2
    s += (rint) * (rint + 1) // 2
    toprheight.append(lint)
    toplheight.append(rint)
    # print('l',l)
    # print('s',s)
    nowtop = nexttop
toprheight.append(-10)
if zeroflag:
    del toplheight[0]
    del toprheight[0]
if lastflag:
    toplheight.pop()
    toprheight.pop()
while toplheight:
    left = toplheight.pop()
    right = toprheight.pop()
    s += max(left, right) + 1
print(s)

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
"""
GC040 A-2
"""
ali = list(eval(input()))
tmp = 0
b = [0]
for L in ali:
    if L == "<":
        tmp += 1
    else:
        tmp = 0
    b.append(tmp)
tmp = 0
c = [0]
ali.reverse()
for L in ali:
    if L == ">":
        tmp += 1
    else:
        tmp = 0
    c.append(tmp)
c.reverse()
numlist = [max(a, b) for (a, b) in zip(b, c)]
print((sum(numlist)))

-GC040 A +GC040 A-2 -zeroflag = False -lastflag = False -if ali[0] == "<": -    ali.insert(0, ">") -    zeroflag = True -if ali[-1] == ">": -    ali.append("<") -    lastflag = True -itop = [] -ibtm = [] -# print(ali) -for (i, x) in enumerate(ali[:-1]): -    # print(i) -    if x == ">" and ali[i + 1] == "<": -        ibtm.append(i + 1) -    if x == "<" and ali[i + 1] == ">": -        itop.append(i + 1) -itop.append(len(ali)) -# print(itop) -# print(ibtm) -s = 0 -nowtop = 0 -toplheight = [-10] -toprheight = [] -for l in range(len(itop)): -    nexttop = itop[l] -    nowbtm = ibtm[l] -    lint = nowbtm - nowtop - 1 -    rint = nexttop - nowbtm - 1 -    s += (lint) * (lint + 1) // 2 -    s += (rint) * (rint + 1) // 2 -    toprheight.append(lint) -    toplheight.append(rint) -    # print('l',l) -    # print('s',s) -    nowtop = nexttop -toprheight.append(-10) -if zeroflag: -    del toplheight[0] -    del toprheight[0] -if lastflag: -    toplheight.pop() -    toprheight.pop() -while toplheight: -    left = toplheight.pop() -    right = toprheight.pop() -    s += max(left, right) + 1 -print(s) +tmp = 0 +b = [0] +for L in ali: +    if L == "<": +        tmp += 1 +    else: +        tmp = 0 +    b.append(tmp) +tmp = 0 +c = [0] +ali.reverse() +for L in ali: +    if L == ">": +        tmp += 1 +    else: +        tmp = 0 +    c.append(tmp) +c.reverse() +numlist = [max(a, b) for (a, b) in zip(b, c)] +print((sum(numlist)))