output_description: Find the minimum possible sum of the elements of a good sequence of N non-
  negative integers.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: S = input()
  d = []
  lt = 0
  gt = 0
  for i in range(len(S)):
      if i == 0:
          continue
      if S[i - 1] == S[i] and S[i] == "<":
          lt += 1
      if S[i - 1] == S[i] and S[i] == ">":
          gt += 1
      if S[i - 1] != S[i] and S[i - 1] == "<":
          d.append("<" * (lt + 1))
          lt = 0
      if S[i - 1] != S[i] and S[i - 1] == ">":
          d.append(">" * (gt + 1))
          gt = 0
      if i == len(S) - 1 and S[i] == "<":
          d.append("<" * (lt + 1))
      if i == len(S) - 1 and S[i] == ">":
          d.append(">" * (gt + 1))
  
  print(d)
  ans = 0
  
  if d[0][0] == "<":
      i = 0
      while i < len(d) - 1:
          if i != len(d) - 1:
              if len(d[i]) >= len(d[i + 1]):
                  for i in range(1, len(d[i]) + 1):
                      ans += i
                  for i in range(1, len(d)):
                      ans += i
                  i += 2
              elif len(d[i]) < len(d[i + 1]):
                  for i in range(1, len(d[i]) + 1):
                      ans += i
                  for i in range(1, len(d)):
                      ans += i
                  i += 2
          elif i == len(d) - 1:
              for i in range(1, len(d[i]) + 1):
                  ans += i
                  i += 1
  
  if d[0][0] == ">":
      ans += (len(d[i]) + 1) * len(d[i]) / 2
      i = 1
      while i < len(d) - 1:
          if i != len(d) - 1:
              if len(d[i]) >= len(d[i + 1]):
                  ans += (len(d[i]) + 1) * len(d[i]) / 2 + (len(d[i + 1])) * len(
                      d[i + 1]
                  ) / 2
                  i += 2
              elif len(d[i]) < len(d[i + 1]):
                  ans += (len(d[i])) * len(d[i]) / 2 + (len(d[i + 1]) + 1) * len(
                      d[i + 1]
                  ) / 2
                  i += 2
          elif i == len(d) - 1:
              ans += (len(d[i]) + 1) * len(d[i]) / 2
  
  print(ans)
  
  
  # min_d = 0
  # for i in d:
  #     min_d = min(min_d, d[i])
  
  # d = list(map(lambda x: x + abs(min_d), d))
  
  # if S[0] == "<":
  #     d[0] = 0
  
  # ans = 0
  # for i in range(len(S)):
  #     ans += d[i]
  # print(d)
  # print(ans)
  
problem_description: Statement
  
  Given is a string S of length N-1. Each character in S is `<` or `>`.
  
  A sequence of N non-negative integers, a_1,a_2,\cdots,a_N, is said to be
  _good_ when the following condition is satisfied for all i (1 \leq i \leq
  N-1):
  
    * If S_i= `<`: a_i<a_{i+1}
    * If S_i= `>`: a_i>a_{i+1}
  
  Find the minimum possible sum of the elements of a good sequence of N non-
  negative integers.
samples: [{"input": "<>>", "output": "3\n    \n\na=(0,2,1,0) is a good sequence whose sum is 3. There is no good sequence whose\nsum is less than 3.\n\n* * *"}, {"input": "<>>><<><<<<<>>><", "output": "28"}]