# とりあえずランレングスhttps://www.kabegiwablog.com/entry/2018/04/09/100000
# 引数を配列に格納
# num = "><>>><<><<<<<>>><"
num = input()

# 変数初期化
count = 1
result = ''

# 配列全体のループ
for i in range(len(num)):
    try:
        if num[i] == num[i+1]:
           count = count + 1
        else:
            result = result + str(count) + str(num[i])
            count = 1
    except:
        # 最後の文字セットがOutOfRangeになるので結果に出力
        result = result + str(count) + str(num[i])
        
def sum_numbers(n):
    if n ==0:
        return 0
    return n + sum_numbers(n-1)

ans = 0
num_list = []
char_list = []

for idx, char in enumerate(result):
    if idx % 2 == 1:
        char_list.append(char)
    else:
        num_list.append(int(char))
if len(num_list) == 1:
    ans = sum_numbers(num_list[0])
else:
	if char_list[0] == "<":
	    if len(char_list) % 2 == 1:
	        for i in range(0, len(num_list)-1, 2):
	#             print(num_list[i], num_list[i+1])
	            if num_list[i] < num_list[i+1]:
	                temp_sum = sum_numbers(num_list[i]-1) + sum_numbers(num_list[i+1])
	#             print("上", temp_sum)
	                ans += temp_sum
	            else:
	                temp_sum = sum_numbers(num_list[i]) + sum_numbers(num_list[i+1]-1)
	#             print("下", temp_sum)
	                ans += temp_sum
	#             print(ans)
	        ans += sum_numbers(num_list[-1])
	    else:
	        for i in range(0, len(num_list), 2):
	#             print(num_list[i], num_list[i+1])
	            if num_list[i] < num_list[i+1]:
	                temp_sum = sum_numbers(num_list[i]-1) + sum_numbers(num_list[i+1])
	#             print("上", temp_sum)
	                ans += temp_sum
	            else:
	                temp_sum = sum_numbers(num_list[i]) + sum_numbers(num_list[i+1]-1)
	#             print("下", temp_sum)
	                ans += temp_sum
	#             print(ans)

	if char_list[0] == ">":
	#     print("test",len(char_list)-1 % 2)
	    if (len(char_list)-1) % 2 == 1:
	        for i in range(1, len(num_list)-1, 2):
	#             print(num_list[i], num_list[i+1])
	            if num_list[i] < num_list[i+1]:
	                temp_sum = sum_numbers(num_list[i]-1) + sum_numbers(num_list[i+1])
	                ans += temp_sum
	            else:
	                temp_sum = sum_numbers(num_list[i]) + sum_numbers(num_list[i+1]-1)
	                ans += temp_sum
	        ans += sum_numbers(num_list[-1])
	    else:
	        for i in range(1, len(num_list), 2):
	#             print(num_list[i], num_list[i+1])
	            if num_list[i] < num_list[i+1]:
	                temp_sum = sum_numbers(num_list[i]-1) + sum_numbers(num_list[i+1])
	                ans += temp_sum
	            else:
	                temp_sum = sum_numbers(num_list[i]) + sum_numbers(num_list[i+1]-1)
	                ans += temp_sum
	    ans += sum_numbers(num_list[0])

print(ans)

### FIXED CODE ###

S = input()
N = len(S) + 1
 
A = [0] * N
 
if S[0] == '<':
    A[0] = 0

if S[-1] == '>':
    A[-1] = 0

for i in range(1, N-1):
    if S[i-1] == '>' and S[i] == '<':
        A[i] = 0

for i in range(N-1):
    if S[i] == '<':
        A[i+1] = A[i] + 1

for i in range(N-1)[::-1]:
    if S[i] == '>':
        A[i] = max(A[i], A[i+1] + 1)

print(sum(A))