import sys



iter_num = 5 * (10**5) + 10

sys.setrecursionlimit(iter_num)



s = eval(input())

n = len(s) + 1



a = [0 for _ in range(n)]

next_num=0



def solve(num):

	global next_num

	if num == 0:

		if s[0] == '<':

			a[num] = 0

			next_num = 1

			return 0

		else:

			next_num = 1

			a[num] = solve(num+1) + 1

	if num == n-1:

		if s[n-2] == '>':

			next_num = -1

			a[num] = 0

			return 0

		else:

			a[num] = solve(num-1) + 1

			next_num = -1

			return a[num]



	if s[num-1] == '>' and s[num] == '<':

		next_num = num+1

		a[num] = 0

		return 0

	elif s[num-1] == '>' and s[num] == '>':

		a[num] = solve(num+1) + 1

		return a[num]

	elif s[num-1] == '<' and s[num] == '>':

		next_num = num+1

		a[num] = max(solve(num-1),solve(num+1)) + 1

		return a[num]

	else:

		#a[num] = solve(num-1) + 1

		a[num] = a[num-1] + 1

		next_num = num+1

		return a[num]



while next_num != -1:

	solve(next_num)



#print(a)

print((sum(a)))

s = list(eval(input()))

n = len(s) + 1



i = 0

left = 0

right = 0

ans = 0

tmp = 0



while i < n-1:

	if s[i] == '<':

		break

	i += 1

	tmp += 1

ans += tmp * (tmp + 1) // 2

while i < n-1:

	if i == n-2:

		if s[i] == '>':

			right += 1

			break

		else:

			left += 1

			break

	if s[i] == '<' and s[i+1] == '>':

		left += 1

		while True:

			if s[i+1+right] == '>':

				right += 1

				if i+1+right == n-1:

					break

			else:

				break

		if left >= right:

			ans += left * (left + 1) // 2 + (right - 1) * right // 2

		else:

			ans += right * (right + 1) // 2 + (left - 1) * left // 2

		i += right + 1

		left = 0

		right = 0

	elif s[i] == '<':

		left += 1

		i += 1



print((ans + left * (left + 1) // 2 + right * (right + 1) // 2 ))

import sys

iter_num = 5 * (10**5) + 10
sys.setrecursionlimit(iter_num)
s = eval(input())
n = len(s) + 1
a = [0 for _ in range(n)]
next_num = 0


def solve(num):
    global next_num
    if num == 0:
        if s[0] == "<":
            a[num] = 0
            next_num = 1
            return 0
        else:
            next_num = 1
            a[num] = solve(num + 1) + 1
    if num == n - 1:
        if s[n - 2] == ">":
            next_num = -1
            a[num] = 0
            return 0
        else:
            a[num] = solve(num - 1) + 1
            next_num = -1
            return a[num]
    if s[num - 1] == ">" and s[num] == "<":
        next_num = num + 1
        a[num] = 0
        return 0
    elif s[num - 1] == ">" and s[num] == ">":
        a[num] = solve(num + 1) + 1
        return a[num]
    elif s[num - 1] == "<" and s[num] == ">":
        next_num = num + 1
        a[num] = max(solve(num - 1), solve(num + 1)) + 1
        return a[num]
    else:
        # a[num] = solve(num-1) + 1
        a[num] = a[num - 1] + 1
        next_num = num + 1
        return a[num]


while next_num != -1:
    solve(next_num)
# print(a)
print((sum(a)))

s = list(eval(input()))
n = len(s) + 1
i = 0
left = 0
right = 0
ans = 0
tmp = 0
while i < n - 1:
    if s[i] == "<":
        break
    i += 1
    tmp += 1
ans += tmp * (tmp + 1) // 2
while i < n - 1:
    if i == n - 2:
        if s[i] == ">":
            right += 1
            break
        else:
            left += 1
            break
    if s[i] == "<" and s[i + 1] == ">":
        left += 1
        while True:
            if s[i + 1 + right] == ">":
                right += 1
                if i + 1 + right == n - 1:
                    break
            else:
                break
        if left >= right:
            ans += left * (left + 1) // 2 + (right - 1) * right // 2
        else:
            ans += right * (right + 1) // 2 + (left - 1) * left // 2
        i += right + 1
        left = 0
        right = 0
    elif s[i] == "<":
        left += 1
        i += 1
print((ans + left * (left + 1) // 2 + right * (right + 1) // 2))

-import sys - -iter_num = 5 * (10**5) + 10 -sys.setrecursionlimit(iter_num) -s = eval(input()) +s = list(eval(input())) -a = [0 for _ in range(n)] -next_num = 0 - - -def solve(num): -    global next_num -    if num == 0: -        if s[0] == "<": -            a[num] = 0 -            next_num = 1 -            return 0 +i = 0 +left = 0 +right = 0 +ans = 0 +tmp = 0 +while i < n - 1: +    if s[i] == "<": +        break +    i += 1 +    tmp += 1 +ans += tmp * (tmp + 1) // 2 +while i < n - 1: +    if i == n - 2: +        if s[i] == ">": +            right += 1 +            break -            next_num = 1 -            a[num] = solve(num + 1) + 1 -    if num == n - 1: -        if s[n - 2] == ">": -            next_num = -1 -            a[num] = 0 -            return 0 +            left += 1 +            break +    if s[i] == "<" and s[i + 1] == ">": +        left += 1 +        while True: +            if s[i + 1 + right] == ">": +                right += 1 +                if i + 1 + right == n - 1: +                    break +            else: +                break +        if left >= right: +            ans += left * (left + 1) // 2 + (right - 1) * right // 2 -            a[num] = solve(num - 1) + 1 -            next_num = -1 -            return a[num] -    if s[num - 1] == ">" and s[num] == "<": -        next_num = num + 1 -        a[num] = 0 -        return 0 -    elif s[num - 1] == ">" and s[num] == ">": -        a[num] = solve(num + 1) + 1 -        return a[num] -    elif s[num - 1] == "<" and s[num] == ">": -        next_num = num + 1 -        a[num] = max(solve(num - 1), solve(num + 1)) + 1 -        return a[num] -    else: -        # a[num] = solve(num-1) + 1 -        a[num] = a[num - 1] + 1 -        next_num = num + 1 -        return a[num] - - -while next_num != -1: -    solve(next_num) -# print(a) -print((sum(a))) +            ans += right * (right + 1) // 2 + (left - 1) * left // 2 +        i += right + 1 +        left = 0 +        right = 0 +    elif s[i] == "<": +        left += 1 +        i += 1 +print((ans + left * (left + 1) // 2 + right * (right + 1) // 2))