Canada Cup 2016
A
Jumping Ball
Codeforces
1000
原题
←B →
翻译中…

In a new version of the famous Pinball game, one of the most important parts of the game field is a sequence of $*n*$ bumpers. The bumpers are numbered with integers from $1$ to $*n*$ from left to right. There are two types of bumpers. They are denoted by the characters '<' and '>'. When the ball hits the bumper at position $*i*$ it goes one position to the right (to the position $*i* + 1$) if the type of this bumper is '>', or one position to the left (to $*i* - 1$) if the type of the bumper at position $*i*$ is '<'. If there is no such position, in other words if $*i* - 1 < 1$ or $*i* + 1 > *n*$, the ball falls from the game field.

翻译中…

Depending on the ball's starting position, the ball may eventually fall from the game field or it may stay there forever. You are given a string representing the bumpers' types. Calculate the number of positions such that the ball will eventually fall from the game field if it starts at that position.

翻译中…

Input

翻译中…

The first line of the input contains a single integer $*n*$ ($1 ≤ *n* ≤ 200 000$) — the length of the sequence of bumpers. The second line contains the string, which consists of the characters '<' and '>'. The character at the $*i*$-th position of this string corresponds to the type of the $*i*$-th bumper.

翻译中…

Output

翻译中…

Print one integer — the number of positions in the sequence such that the ball will eventually fall from the game field if it starts at that position.

翻译中…

Note

翻译中…

In the first sample, the ball will fall from the field if starts at position $1$ or position $2$.

翻译中…

In the second sample, any starting position will result in the ball falling from the field.

翻译中…

样例

Input #1
4
<<><
Output #1
2
InputCopy OutputCopy
Input #2
5
>>>>>
Output #2
5
InputCopy OutputCopy
Input #3
4
>><<
Output #3
0
InputCopy OutputCopy
题目信息
题号
725A
所属比赛
时间限制
2 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。