{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ of length $N-1$ consisting of `<` and `>`.\nA sequence $x=(x_1,x_2,\\cdots,x_N)$ of length $N$ is called a **good sequence** if and only if it satisfies the following condition:\n\n*   For each $i$ ($1 \\leq i \\leq N-1$), if the $i$\\-th character of $S$ is `<`, then $x_i\\lt x_{i+1}$; if it is `>`, then $x_i \\gt x_{i+1}$.\n\nFind the minimum possible inversion number of a good sequence.\nWhat is the inversion number of a sequence?The inversion number of a sequence $x=(x_1,x_2,\\cdots,x_n)$ of length $n$ is the number of pairs of integers $(i,j)$ ($1 \\leq i < j \\leq n$) such that $x_i>x_j$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 250000$\n*   $S$ is a string of length $N-1$ consisting of `<` and `>`.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$S$"},{"iden":"sample input 1","content":"4\n<><"},{"iden":"sample output 1","content":"1\n\n$x=(1,2,1,2)$ is a good sequence, and its inversion number is $1$. There is no good sequence whose inversion number is $0$, so the answer is $1$."},{"iden":"sample input 2","content":"2\n<"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"10\n>>>>>>>>>"},{"iden":"sample output 3","content":"45"},{"iden":"sample input 4","content":"30\n<<><>>><><>><><><<>><<<><><<>"},{"iden":"sample output 4","content":"19"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}