S = eval(input())

nums = [0] * (len(S)+1)

pos = 0

count = 0

pre_count = 0

now = '>'

for (i, s) in enumerate(S):

  if s != now:

    if s == '<':

      nums[pos] = max(pre_count, count)

      while pos != i:

        pos += 1

        count -= 1

        nums[pos] = count

    else:

      pos = i

      pre_count = count+1

      count = 1

    now = s

  else:

    count += 1

    if s == '<':

      nums[i] = count

if now == '<':

  nums[i+1] = count+1



if s == '>':

  nums[pos] = max(pre_count, count)

  while pos != i+1:

    pos += 1

    count -= 1

    nums[pos] = count



print((sum(nums)))
S = eval(input())

A = [0] * (len(S)+1)



sstreak = 0

bstreak = 0

for i in range(len(S)):

  if S[i] == "<":

    if 0 < bstreak:

      A[i-bstreak] = max(bstreak, sstreak)

      bstreak -= 1

      while 0 < bstreak:

        A[i-bstreak] = bstreak

        bstreak -= 1

      sstreak = 0

    A[i] = sstreak

    sstreak += 1

  else:

    bstreak += 1

i+=1

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

  A[i] = sstreak



if 0 < bstreak:

  A[i-bstreak] = max(bstreak, sstreak)

  bstreak -= 1

  while 0 < bstreak:

    A[i-bstreak] = bstreak

    bstreak -= 1



print((sum(A)))
S = eval(input())
nums = [0] * (len(S) + 1)
pos = 0
count = 0
pre_count = 0
now = ">"
for (i, s) in enumerate(S):
    if s != now:
        if s == "<":
            nums[pos] = max(pre_count, count)
            while pos != i:
                pos += 1
                count -= 1
                nums[pos] = count
        else:
            pos = i
            pre_count = count + 1
            count = 1
        now = s
    else:
        count += 1
        if s == "<":
            nums[i] = count
if now == "<":
    nums[i + 1] = count + 1
if s == ">":
    nums[pos] = max(pre_count, count)
    while pos != i + 1:
        pos += 1
        count -= 1
        nums[pos] = count
print((sum(nums)))

S = eval(input())
A = [0] * (len(S) + 1)
sstreak = 0
bstreak = 0
for i in range(len(S)):
    if S[i] == "<":
        if 0 < bstreak:
            A[i - bstreak] = max(bstreak, sstreak)
            bstreak -= 1
            while 0 < bstreak:
                A[i - bstreak] = bstreak
                bstreak -= 1
            sstreak = 0
        A[i] = sstreak
        sstreak += 1
    else:
        bstreak += 1
i += 1
if S[-1] == "<":
    A[i] = sstreak
if 0 < bstreak:
    A[i - bstreak] = max(bstreak, sstreak)
    bstreak -= 1
    while 0 < bstreak:
        A[i - bstreak] = bstreak
        bstreak -= 1
print((sum(A)))

-nums = [0] * (len(S) + 1) -pos = 0 -count = 0 -pre_count = 0 -now = ">" -for (i, s) in enumerate(S): -    if s != now: -        if s == "<": -            nums[pos] = max(pre_count, count) -            while pos != i: -                pos += 1 -                count -= 1 -                nums[pos] = count -        else: -            pos = i -            pre_count = count + 1 -            count = 1 -        now = s +A = [0] * (len(S) + 1) +sstreak = 0 +bstreak = 0 +for i in range(len(S)): +    if S[i] == "<": +        if 0 < bstreak: +            A[i - bstreak] = max(bstreak, sstreak) +            bstreak -= 1 +            while 0 < bstreak: +                A[i - bstreak] = bstreak +                bstreak -= 1 +            sstreak = 0 +        A[i] = sstreak +        sstreak += 1 -        count += 1 -        if s == "<": -            nums[i] = count -if now == "<": -    nums[i + 1] = count + 1 -if s == ">": -    nums[pos] = max(pre_count, count) -    while pos != i + 1: -        pos += 1 -        count -= 1 -        nums[pos] = count -print((sum(nums))) +        bstreak += 1 +i += 1 +if S[-1] == "<": +    A[i] = sstreak +if 0 < bstreak: +    A[i - bstreak] = max(bstreak, sstreak) +    bstreak -= 1 +    while 0 < bstreak: +        A[i - bstreak] = bstreak +        bstreak -= 1 +print((sum(A)))