Problem G
Gangur
Languages
en
is
Input
The input consists of a single line describing the contents of all the section of the hallway. The hallway is at least $1$ section and at most $10^6$ sections. If the hallway is described by > then there is a person there facing right. If the hallway is described by < then there is a person there facing left. If the hallway is described by - then there is no person there.
Output
The output should contain a single integer, the number of times two people pass each other in the hallway.
Scoring
|
Group |
Points |
Constraints |
|
1 |
25 |
The only section described by > is the first section |
|
2 |
25 |
All > are to the left of < |
|
3 |
25 |
There are at most $1\, 000$ sections |
|
4 |
25 |
No further constraints |
| Sample Input 1 | Sample Output 1 |
|---|---|
>-<-<<-< |
4 |
| Sample Input 2 | Sample Output 2 |
|---|---|
>->>-->-<<-<<< |
20 |
| Sample Input 3 | Sample Output 3 |
|---|---|
<><-<->-< |
4 |
