# for c in '03210120123452101':

# 3 2 5 2

s = eval(input())

lst = []

tmp = ''

cnt = 1

for c in s:

    if tmp == c:

        cnt += 1

    else :

        lst.append(cnt)

        cnt = 1

    tmp = c

lst.append(cnt)



ans = 0



if s[0] == '<':

    idx = 1

else:

    idx = 0

if (len(lst) - idx ) % 2 == 1:

    lst.append(1)

for i in range(idx,len(lst),2):

    if lst[i] > 1:

        if lst[i] <= lst[i+1]:

            lst[i] -= 1

        ans += lst[i] * (lst[i]+1) // 2

    if lst[i+1] > 1:

        if lst[i] > lst[i+1]:

            lst[i+1] -= 1

        ans += lst[i+1] * (lst[i+1]+1) // 2

    if lst[i] == 1 and lst[i+1] == 1:

        ans += 1

    # print(lst[i], lst[i+1])

print(ans)

# print(lst, idx)
def run_length(data, init=''):

    length = []

    tmp = init

    cnt = 0

    for c in data:

        if tmp != c:

            length.append(cnt)

            cnt = 0

        tmp = c

        cnt += 1

    length.append(cnt)

    return length





def resolve():

    s = eval(input())

    if s[0] != '<':

        s = '<' + s

    if s[-1] != '>':

        s = s + '>'



    array = run_length(s)

    ans = 0

    for i in range(1, len(array), 2):

        a,b = array[i], array[i+1]

        mn = min(a,b) - 1

        mx = max(a,b)

        ans += (mn+1) * (mn) // 2 + mx * (mx+1) // 2

    #     print(a,b, (mn+1) * (mn) // 2 + mx * (mx+1) // 2)

    # print(array)

    print(ans)



if __name__ == "__main__":

    resolve()

# for c in '03210120123452101':
# 3 2 5 2
s = eval(input())
lst = []
tmp = ""
cnt = 1
for c in s:
    if tmp == c:
        cnt += 1
    else:
        lst.append(cnt)
        cnt = 1
    tmp = c
lst.append(cnt)
ans = 0
if s[0] == "<":
    idx = 1
else:
    idx = 0
if (len(lst) - idx) % 2 == 1:
    lst.append(1)
for i in range(idx, len(lst), 2):
    if lst[i] > 1:
        if lst[i] <= lst[i + 1]:
            lst[i] -= 1
        ans += lst[i] * (lst[i] + 1) // 2
    if lst[i + 1] > 1:
        if lst[i] > lst[i + 1]:
            lst[i + 1] -= 1
        ans += lst[i + 1] * (lst[i + 1] + 1) // 2
    if lst[i] == 1 and lst[i + 1] == 1:
        ans += 1
    # print(lst[i], lst[i+1])
print(ans)
# print(lst, idx)

def run_length(data, init=""):
    length = []
    tmp = init
    cnt = 0
    for c in data:
        if tmp != c:
            length.append(cnt)
            cnt = 0
        tmp = c
        cnt += 1
    length.append(cnt)
    return length


def resolve():
    s = eval(input())
    if s[0] != "<":
        s = "<" + s
    if s[-1] != ">":
        s = s + ">"
    array = run_length(s)
    ans = 0
    for i in range(1, len(array), 2):
        a, b = array[i], array[i + 1]
        mn = min(a, b) - 1
        mx = max(a, b)
        ans += (mn + 1) * (mn) // 2 + mx * (mx + 1) // 2
    #     print(a,b, (mn+1) * (mn) // 2 + mx * (mx+1) // 2)
    # print(array)
    print(ans)


if __name__ == "__main__":
    resolve()

-# for c in '03210120123452101': -# 3 2 5 2 -s = eval(input()) -lst = [] -tmp = "" -cnt = 1 -for c in s: -    if tmp == c: +def run_length(data, init=""): +    length = [] +    tmp = init +    cnt = 0 +    for c in data: +        if tmp != c: +            length.append(cnt) +            cnt = 0 +        tmp = c -    else: -        lst.append(cnt) -        cnt = 1 -    tmp = c -lst.append(cnt) -ans = 0 -if s[0] == "<": -    idx = 1 -else: -    idx = 0 -if (len(lst) - idx) % 2 == 1: -    lst.append(1) -for i in range(idx, len(lst), 2): -    if lst[i] > 1: -        if lst[i] <= lst[i + 1]: -            lst[i] -= 1 -        ans += lst[i] * (lst[i] + 1) // 2 -    if lst[i + 1] > 1: -        if lst[i] > lst[i + 1]: -            lst[i + 1] -= 1 -        ans += lst[i + 1] * (lst[i + 1] + 1) // 2 -    if lst[i] == 1 and lst[i + 1] == 1: -        ans += 1 -    # print(lst[i], lst[i+1]) -print(ans) -# print(lst, idx) +    length.append(cnt) +    return length + + +def resolve(): +    s = eval(input()) +    if s[0] != "<": +        s = "<" + s +    if s[-1] != ">": +        s = s + ">" +    array = run_length(s) +    ans = 0 +    for i in range(1, len(array), 2): +        a, b = array[i], array[i + 1] +        mn = min(a, b) - 1 +        mx = max(a, b) +        ans += (mn + 1) * (mn) // 2 + mx * (mx + 1) // 2 +    #     print(a,b, (mn+1) * (mn) // 2 + mx * (mx+1) // 2) +    # print(array) +    print(ans) + + +if __name__ == "__main__": +    resolve()