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()
  count_more = 0
  count_less = 0
  ans = 0
  pre_si = ">"
  for i, si in enumerate(S):
      if pre_si == ">" and si == "<":
          max_n = max(count_more, count_less)
          min_n = min(count_more, count_less)
          ans += (max_n + 1) * (max_n) // 2
          # print(i, ans)
          ans += (min_n) * (min_n - 1) // 2
          count_more = 0
          count_less = 0
          # print(i, ans)
      if si == "<":
          count_more += 1
      elif si == ">":
          count_less += 1
      pre_si = si
  max_n = max(count_more, count_less)
  min_n = min(count_more, count_less)
  ans += (max_n + 1) * (max_n) // 2
  ans += (min_n) * (min_n - 1) // 2
  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"}]