import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2

from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left, insort, insort_left

from fractions import gcd

from heapq import heappush, heappop

from functools import reduce

def input(): return sys.stdin.readline().strip()

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

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

def ZIP(n): return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10**9 + 7

#from decimal import *



S = eval(input())

N = len(S) + 1



l = [0]*N

r = [0]*N



tmp_l = 0

for i in range(N-1):

	if S[i] == "<":

		tmp_l += 1

		l[i+1] = tmp_l

	else:

		tmp_l = 0



tmp_r = 0

for i in range(N-2, -1,  -1):

	if S[i] == ">":

		tmp_r += 1

		r[i] =tmp_r

	else:

		tmp_r = 0



t = [max(r[i], l[i]) for i in range(N)]

ans = 0

for i in range(N):

	ans += max(l[i], r[i])



#print(l)

#print(r)

#print(t)



print(ans)

import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2

from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left, insort, insort_left

from fractions import gcd

from heapq import heappush, heappop

from functools import reduce

def input(): return sys.stdin.readline().strip()

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

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

def ZIP(n): return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10**9 + 7

#from decimal import *



S = eval(input())

N = len(S) + 1



l = [0]*N

r = [0]*N



tmp_l = 0

for i in range(N-1):

	if S[i] == "<":

		tmp_l += 1

		l[i+1] = tmp_l

	else:

		tmp_l = 0



tmp_r = 0

for i in range(N-1):

	if S[N-i-2] == ">":

		tmp_r += 1

		r[i+1] = tmp_r

	else:

		tmp_r = 0

r = r[::-1]



t = [max(r[i], l[i]) for i in range(N)]

print((sum(t)))



import sys, re
from collections import deque, defaultdict, Counter
from math import (
    ceil,
    sqrt,
    hypot,
    factorial,
    pi,
    sin,
    cos,
    tan,
    asin,
    acos,
    atan,
    radians,
    degrees,
)  # , log2
from itertools import (
    accumulate,
    permutations,
    combinations,
    combinations_with_replacement,
    product,
    groupby,
)
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce


def input():
    return sys.stdin.readline().strip()


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


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(map(int, input().split()))


def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))


sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7
# from decimal import *
S = eval(input())
N = len(S) + 1
l = [0] * N
r = [0] * N
tmp_l = 0
for i in range(N - 1):
    if S[i] == "<":
        tmp_l += 1
        l[i + 1] = tmp_l
    else:
        tmp_l = 0
tmp_r = 0
for i in range(N - 2, -1, -1):
    if S[i] == ">":
        tmp_r += 1
        r[i] = tmp_r
    else:
        tmp_r = 0
t = [max(r[i], l[i]) for i in range(N)]
ans = 0
for i in range(N):
    ans += max(l[i], r[i])
# print(l)
# print(r)
# print(t)
print(ans)

import sys, re
from collections import deque, defaultdict, Counter
from math import (
    ceil,
    sqrt,
    hypot,
    factorial,
    pi,
    sin,
    cos,
    tan,
    asin,
    acos,
    atan,
    radians,
    degrees,
)  # , log2
from itertools import (
    accumulate,
    permutations,
    combinations,
    combinations_with_replacement,
    product,
    groupby,
)
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce


def input():
    return sys.stdin.readline().strip()


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


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(map(int, input().split()))


def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))


sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7
# from decimal import *
S = eval(input())
N = len(S) + 1
l = [0] * N
r = [0] * N
tmp_l = 0
for i in range(N - 1):
    if S[i] == "<":
        tmp_l += 1
        l[i + 1] = tmp_l
    else:
        tmp_l = 0
tmp_r = 0
for i in range(N - 1):
    if S[N - i - 2] == ">":
        tmp_r += 1
        r[i + 1] = tmp_r
    else:
        tmp_r = 0
r = r[::-1]
t = [max(r[i], l[i]) for i in range(N)]
print((sum(t)))

-for i in range(N - 2, -1, -1): -    if S[i] == ">": +for i in range(N - 1): +    if S[N - i - 2] == ">": -        r[i] = tmp_r +        r[i + 1] = tmp_r +r = r[::-1] -ans = 0 -for i in range(N): -    ans += max(l[i], r[i]) -# print(l) -# print(r) -# print(t) -print(ans) +print((sum(t)))