s = str(eval(input()))



f = "" # 前回のステップの文字 "<" or ">" 

ans = 0 # Answer

count = 0 # Ai

continuous = 0 # ">" が何回連続するか



for m in s:

  if m=="<":

    if f==">" and count>0:

      # 清算

      ans-=count*continuous

      count=0

    count+=1



  else:

    if f=="<":

      # セット

      continuous=0

    count-=1

    continuous+=1

    if count==-1:

      ans+=continuous

      count=0

      continue



  ans+=count

  f=m



print(ans)
def main():

  import sys



  f = "" # 前回のステップの文字 "<" or ">" 

  ans = 0 # Answer

  count = 0 # Ai

  continuous = 0 # ">" が何回連続するか

  

  for m in sys.stdin.readline().strip("\n"):

    if m=="<":

      if f==">" and count>0:

        # 清算

        ans-=count*continuous

        count=0

      count+=1

        

    else:

      if f=="<":

        # セット

        continuous=0

      count-=1

      continuous+=1

      if count==-1:

        ans+=continuous

        count=0

        continue



    ans+=count

    f=m



  print(ans)

    

if __name__ == '__main__':

    main()
s = str(eval(input()))
f = ""  # 前回のステップの文字 "<" or ">"
ans = 0  # Answer
count = 0  # Ai
continuous = 0  # ">" が何回連続するか
for m in s:
    if m == "<":
        if f == ">" and count > 0:
            # 清算
            ans -= count * continuous
            count = 0
        count += 1
    else:
        if f == "<":
            # セット
            continuous = 0
        count -= 1
        continuous += 1
        if count == -1:
            ans += continuous
            count = 0
            continue
    ans += count
    f = m
print(ans)

def main():
    import sys

    f = ""  # 前回のステップの文字 "<" or ">"
    ans = 0  # Answer
    count = 0  # Ai
    continuous = 0  # ">" が何回連続するか
    for m in sys.stdin.readline().strip("\n"):
        if m == "<":
            if f == ">" and count > 0:
                # 清算
                ans -= count * continuous
                count = 0
            count += 1
        else:
            if f == "<":
                # セット
                continuous = 0
            count -= 1
            continuous += 1
            if count == -1:
                ans += continuous
                count = 0
                continue
        ans += count
        f = m
    print(ans)


if __name__ == "__main__":
    main()

-s = str(eval(input())) -f = ""  # 前回のステップの文字 "<" or ">" -ans = 0  # Answer -count = 0  # Ai -continuous = 0  # ">" が何回連続するか -for m in s: -    if m == "<": -        if f == ">" and count > 0: -            # 清算 -            ans -= count * continuous -            count = 0 -        count += 1 -    else: -        if f == "<": -            # セット -            continuous = 0 -        count -= 1 -        continuous += 1 -        if count == -1: -            ans += continuous -            count = 0 -            continue -    ans += count -    f = m -print(ans) +def main(): +    import sys + +    f = ""  # 前回のステップの文字 "<" or ">" +    ans = 0  # Answer +    count = 0  # Ai +    continuous = 0  # ">" が何回連続するか +    for m in sys.stdin.readline().strip("\n"): +        if m == "<": +            if f == ">" and count > 0: +                # 清算 +                ans -= count * continuous +                count = 0 +            count += 1 +        else: +            if f == "<": +                # セット +                continuous = 0 +            count -= 1 +            continuous += 1 +            if count == -1: +                ans += continuous +                count = 0 +                continue +        ans += count +        f = m +    print(ans) + + +if __name__ == "__main__": +    main()