Output numbers, more or less The Challenge
Given an input string (or array) consisting of &lt; and &gt;, output a sequence (array or string) of integers such that:

the operators are all correct when applied in order between consecutive numbers in the output
all integers are positive (1 or greater)
the sum of the integers is as small as is mathematically possible

Inputs can vary to match &quot;greater than&quot; and &quot;less than&quot; in your chosen language.
As an alternative output, just specify the sum of the numbers in the output. State which version you're solving in your Answer title.
Usual exclusions and rules apply, smallest bytes wins.
You can assume that the input string will never lead to an integer overflow in your language, if that helps.
Examples

&gt; gives 2 1 which sums to 3
&gt;&gt;&gt; gives 4 3 2 1 which sums to 10
&gt;&lt; gives 2 1 2 which sums to 5
 gives 1 which sums to 1
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; gives 10 9 8 7  6 5 4 3 2 1 which sums to 55
&gt;&gt;&lt;&lt;&gt;&gt;&lt;&gt;&gt;&gt; gives 3 2 1 2 3 2 1 4 3 2 1 which sums to 24
&gt;&lt;&gt;&gt;&lt;&gt;&gt;&lt;&gt; gives 2 1 3 2 1 3 2 1 2 1 which sums to 18
&lt;&lt;&lt;&lt;&gt; gives 1 2 3 4 5 1 which sums to 16
&lt;&lt;&lt;&lt;&gt;&lt;&lt;&gt; gives 1 2 3 4 5 1 2 3 1 which sums to 22
&gt;&gt;&lt;&lt; gives 3 2 1 2 3 which sums to 11
>&lt;>, 40 38 bytes

1v!rnr~&lt;oa
?\i:0(?^3%\+$
{/?:-{:}-1/1:


Try it online!

An appropriate language. For reference &gt;&lt;&gt; itself yields 2,1,2,1.

How it Works:

1v   Initialise the stack as 1 and enter loop
 \i:0(?^  If we're out of input, go to the first line
        3%\ Otherwise mod the input by 3, yielding 0 for &lt; and 2 for &gt;
        -1/Subtract 1 to get -1 and 1 respectively
    -{:}   Copy the previous number and subtract the above from it

 /?:    If the number is not 0, repeat the loop

?\        \+$  Otherwise:
                Increment each number until we reach the original 0
{/        /1:   And enter the first loop again

      ~&lt;    When we're out of input, pop the extra -1 from EOF
   rnr      Output the first number
1v!         Push a 1 
        oa  Print a newline and repeat, popping the extra 1 each time