{"problem":{"name":"<Inversion>","description":{"content":"You are given a string $S$ of length $N-1$ consisting of `<` and `>`. A 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 conditio","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc168_a"},"statements":[{"statement_type":"Markdown","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$.\n\n## Constraints\n\n*   $2 \\leq N \\leq 250000$\n*   $S$ is a string of length $N-1$ consisting of `<` and `>`.\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc168_a","tags":[],"sample_group":[["4\n<><","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$."],["2\n<","0"],["10\n>>>>>>>>>","45"],["30\n<<><>>><><>><><><<>><<<><><<>","19"]],"created_at":"2026-03-03 11:01:14"}}