import sys

input = sys.stdin.readline  # NOQA





def left(T, S, a, i):

    # ...>>><

    j = 1

    l = i

    while 0 <= l:

        if S[l] == ">" and a[l] < j:

            a[l] = j

            l -= 1

            j += 1

        else:

            break





def right(T, S, a, i):

    # ><<<...

    j = 1

    r = i

    while r <= T - 1:

        if S[r] == "<" and a[r + 1] < j:

            a[r + 1] = j

            r += 1

            j += 1

        else:

            break





def main():

    S = input().rstrip()



    T = len(S)

    N = T + 1

    a = [-1] * N



    if S[0] == "<":

        a[0] = 0

        right(T, S, a, 0)

    for i in range(T - 1):

        if S[i] == ">" and S[i + 1] == "<":

            a[i + 1] = 0

            left(T, S, a, i)

            right(T, S, a, i + 1)

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

        a[N - 1] = 0

        left(T, S, a, T - 1)



    ans = sum(a)

    print(ans)





if __name__ == "__main__":

    main()

import sys



input = sys.stdin.readline





def left(N, S, a, i):

    a[i + 1] = 0

    v = 0

    while True:

        if i == 0:

            a[i] = v + 1

            break

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

            v += 1

            a[i] = v

            i -= 1

        else:

            a[i] = max(a[i], v + 1)

            break





def right(N, S, a, i):

    a[i] = 0

    v = 0

    while True:

        if i == N - 1:

            a[i + 1] = v + 1

            break

        if S[i + 1] == "<":

            i += 1

            v += 1

            a[i] = v

        else:

            a[i + 1] = max(a[i + 1], v + 1)

            break





def main():

    S = input().rstrip()

    N = len(S)



    a = [0] * (N + 1)

    if S[0] == "<":

        right(N, S, a, 0)

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

        left(N, S, a, N - 1)

    for i in range(N - 1):

        if S[i:i + 2] == "><":

            left(N, S, a, i)

            right(N, S, a, i + 1)

    

    ans = sum(a)

    print(ans)





if __name__ == "__main__":

    main()

import sys

input = sys.stdin.readline  # NOQA


def left(T, S, a, i):
    # ...>>><
    j = 1
    l = i
    while 0 <= l:
        if S[l] == ">" and a[l] < j:
            a[l] = j
            l -= 1
            j += 1
        else:
            break


def right(T, S, a, i):
    # ><<<...
    j = 1
    r = i
    while r <= T - 1:
        if S[r] == "<" and a[r + 1] < j:
            a[r + 1] = j
            r += 1
            j += 1
        else:
            break


def main():
    S = input().rstrip()
    T = len(S)
    N = T + 1
    a = [-1] * N
    if S[0] == "<":
        a[0] = 0
        right(T, S, a, 0)
    for i in range(T - 1):
        if S[i] == ">" and S[i + 1] == "<":
            a[i + 1] = 0
            left(T, S, a, i)
            right(T, S, a, i + 1)
    if S[T - 1] == ">":
        a[N - 1] = 0
        left(T, S, a, T - 1)
    ans = sum(a)
    print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def left(N, S, a, i):
    a[i + 1] = 0
    v = 0
    while True:
        if i == 0:
            a[i] = v + 1
            break
        if S[i - 1] == ">":
            v += 1
            a[i] = v
            i -= 1
        else:
            a[i] = max(a[i], v + 1)
            break


def right(N, S, a, i):
    a[i] = 0
    v = 0
    while True:
        if i == N - 1:
            a[i + 1] = v + 1
            break
        if S[i + 1] == "<":
            i += 1
            v += 1
            a[i] = v
        else:
            a[i + 1] = max(a[i + 1], v + 1)
            break


def main():
    S = input().rstrip()
    N = len(S)
    a = [0] * (N + 1)
    if S[0] == "<":
        right(N, S, a, 0)
    if S[-1] == ">":
        left(N, S, a, N - 1)
    for i in range(N - 1):
        if S[i : i + 2] == "><":
            left(N, S, a, i)
            right(N, S, a, i + 1)
    ans = sum(a)
    print(ans)


if __name__ == "__main__":
    main()

-input = sys.stdin.readline  # NOQA +input = sys.stdin.readline -def left(T, S, a, i): -    # ...>>>< -    j = 1 -    l = i -    while 0 <= l: -        if S[l] == ">" and a[l] < j: -            a[l] = j -            l -= 1 -            j += 1 +def left(N, S, a, i): +    a[i + 1] = 0 +    v = 0 +    while True: +        if i == 0: +            a[i] = v + 1 +            break +        if S[i - 1] == ">": +            v += 1 +            a[i] = v +            i -= 1 +            a[i] = max(a[i], v + 1) -def right(T, S, a, i): -    # ><<<... -    j = 1 -    r = i -    while r <= T - 1: -        if S[r] == "<" and a[r + 1] < j: -            a[r + 1] = j -            r += 1 -            j += 1 +def right(N, S, a, i): +    a[i] = 0 +    v = 0 +    while True: +        if i == N - 1: +            a[i + 1] = v + 1 +            break +        if S[i + 1] == "<": +            i += 1 +            v += 1 +            a[i] = v +            a[i + 1] = max(a[i + 1], v + 1) -    T = len(S) -    N = T + 1 -    a = [-1] * N +    N = len(S) +    a = [0] * (N + 1) -        a[0] = 0 -        right(T, S, a, 0) -    for i in range(T - 1): -        if S[i] == ">" and S[i + 1] == "<": -            a[i + 1] = 0 -            left(T, S, a, i) -            right(T, S, a, i + 1) -    if S[T - 1] == ">": -        a[N - 1] = 0 -        left(T, S, a, T - 1) +        right(N, S, a, 0) +    if S[-1] == ">": +        left(N, S, a, N - 1) +    for i in range(N - 1): +        if S[i : i + 2] == "><": +            left(N, S, a, i) +            right(N, S, a, i + 1)