def solve():

    S = eval(input())

    lenS = len(S)

    sumS = 0

    N = [0] * (lenS + 1)

    zero = set()

    if S[0] == "<": zero |= {0}

    for i in range(lenS - 1):

        if S[i] == ">" and S[i+1] == "<": zero |= {i+1}

    if S[lenS-1] == ">": zero |= {lenS}



    for start in zero:

        pointer = start

        while pointer <= lenS - 1:

            if S[pointer] == "<":N[pointer + 1] = max(N[pointer] + 1, N[pointer + 1])

            else: break

            pointer += 1

        

        pointer = start - 1

        while pointer >= 0:

            if S[pointer] == ">": N[pointer] = max(N[pointer + 1] + 1, N[pointer])

            else: break

            pointer -= 1



    #print(N)

    print((sum(N)))



    return 0



if __name__ == "__main__": solve()

import sys



def solve():

    S = eval(input())

    N = len(S)

    A = [0] * (N + 1)

    init = []

    for i in range(N - 1):

        if  S[i] == ">" and S[i + 1] == "<": init.append(i + 1)

    #right



    if S[0] == "<":

        d = 1

        A[d] = A[d - 1] + 1

        while d <= N - 1:

            if S[d] == ">": break

            d += 1

            A[d] = A[d-1] + 1



    for s in init:

        d = s + 1

        A[d] = A[d - 1] + 1

        while d <= N - 1:

            if S[d] == ">": break

            d += 1

            A[d] = A[d-1] + 1



    #left

    if S[N - 1] == ">":

        d = N - 1

        while d >= 0:

            if S[d] == "<": break

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

            d -= 1

            

    for s in init:

        d = s - 1

        while d >= 0:

            if S[d] == "<": break

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

            d -= 1



    print((sum(A)))

    #print(A)



    return 0



if __name__ == "__main__":

    solve()
def solve():
    S = eval(input())
    lenS = len(S)
    sumS = 0
    N = [0] * (lenS + 1)
    zero = set()
    if S[0] == "<":
        zero |= {0}
    for i in range(lenS - 1):
        if S[i] == ">" and S[i + 1] == "<":
            zero |= {i + 1}
    if S[lenS - 1] == ">":
        zero |= {lenS}
    for start in zero:
        pointer = start
        while pointer <= lenS - 1:
            if S[pointer] == "<":
                N[pointer + 1] = max(N[pointer] + 1, N[pointer + 1])
            else:
                break
            pointer += 1
        pointer = start - 1
        while pointer >= 0:
            if S[pointer] == ">":
                N[pointer] = max(N[pointer + 1] + 1, N[pointer])
            else:
                break
            pointer -= 1
    # print(N)
    print((sum(N)))
    return 0


if __name__ == "__main__":
    solve()

import sys


def solve():
    S = eval(input())
    N = len(S)
    A = [0] * (N + 1)
    init = []
    for i in range(N - 1):
        if S[i] == ">" and S[i + 1] == "<":
            init.append(i + 1)
    # right
    if S[0] == "<":
        d = 1
        A[d] = A[d - 1] + 1
        while d <= N - 1:
            if S[d] == ">":
                break
            d += 1
            A[d] = A[d - 1] + 1
    for s in init:
        d = s + 1
        A[d] = A[d - 1] + 1
        while d <= N - 1:
            if S[d] == ">":
                break
            d += 1
            A[d] = A[d - 1] + 1
    # left
    if S[N - 1] == ">":
        d = N - 1
        while d >= 0:
            if S[d] == "<":
                break
            A[d] = max(A[d], A[d + 1] + 1)
            d -= 1
    for s in init:
        d = s - 1
        while d >= 0:
            if S[d] == "<":
                break
            A[d] = max(A[d], A[d + 1] + 1)
            d -= 1
    print((sum(A)))
    # print(A)
    return 0


if __name__ == "__main__":
    solve()

+import sys + + -    lenS = len(S) -    sumS = 0 -    N = [0] * (lenS + 1) -    zero = set() +    N = len(S) +    A = [0] * (N + 1) +    init = [] +    for i in range(N - 1): +        if S[i] == ">" and S[i + 1] == "<": +            init.append(i + 1) +    # right -        zero |= {0} -    for i in range(lenS - 1): -        if S[i] == ">" and S[i + 1] == "<": -            zero |= {i + 1} -    if S[lenS - 1] == ">": -        zero |= {lenS} -    for start in zero: -        pointer = start -        while pointer <= lenS - 1: -            if S[pointer] == "<": -                N[pointer + 1] = max(N[pointer] + 1, N[pointer + 1]) -            else: +        d = 1 +        A[d] = A[d - 1] + 1 +        while d <= N - 1: +            if S[d] == ">": -            pointer += 1 -        pointer = start - 1 -        while pointer >= 0: -            if S[pointer] == ">": -                N[pointer] = max(N[pointer + 1] + 1, N[pointer]) -            else: +            d += 1 +            A[d] = A[d - 1] + 1 +    for s in init: +        d = s + 1 +        A[d] = A[d - 1] + 1 +        while d <= N - 1: +            if S[d] == ">": -            pointer -= 1 -    # print(N) -    print((sum(N))) +            d += 1 +            A[d] = A[d - 1] + 1 +    # left +    if S[N - 1] == ">": +        d = N - 1 +        while d >= 0: +            if S[d] == "<": +                break +            A[d] = max(A[d], A[d + 1] + 1) +            d -= 1 +    for s in init: +        d = s - 1 +        while d >= 0: +            if S[d] == "<": +                break +            A[d] = max(A[d], A[d + 1] + 1) +            d -= 1 +    print((sum(A))) +    # print(A)