atcoder#AGC040A. [AGC040A] ><
[AGC040A] ><
Score : points
Problem Statement
Given is a string of length .
Each character in is <
or >
.
A sequence of non-negative integers, , is said to be good when the following condition is satisfied for all ():
- If
<
: $a_i - If
>
:
Find the minimum possible sum of the elements of a good sequence of non-negative integers.
Constraints
- is a string of length consisting of
<
and>
.
Input
Input is given from Standard Input in the following format:
Output
Find the minimum possible sum of the elements of a good sequence of non-negative integers.
<>>
3
is a good sequence whose sum is . There is no good sequence whose sum is less than .
<>>><<><<<<<>>><
28