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.


-----Examples-----
Input
4
<<><

Output
2
Input
5
>>>>>

Output
5
Input
4
>><<

Output
0


-----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.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
s = input()
l = 0
ans = 0
while l < len(s) and s[l] == '<':
    ans += 1
    l += 1

r = n - 1
while r >= 0 and s[r] == '>':
    ans += 1
    r -= 1

print(ans)


# You lost the game.
n = int(input())
s = str(input())

i = 0
while i < n and s[i] =="<":
    i += 1

if i == n:
    print(n)
else:
    j = n-1
    while j >= 0 and s[j] == ">":
        j -= 1
    print(i+(n-j-1))


n = int(input())
s = input()
ans = 0
for i in range(0, n):
    if s[i] == '<':
        ans += 1
    else:
        break
for i in range(n - 1, -1, -1):
    if s[i] == '>':
        ans += 1
    else:
        break
print(ans)


n = int(input())
s = input()
cnt = 0
for i in s:
    if i != '<': break
    cnt += 1
for i in s[::-1]:
    if i != '>': break
    cnt += 1
print(cnt)


n = int(input())
s = input()
ans = 0

for i in s:
    if i == ">":
        break
    ans+=1
for i in s[::-1]:
    if i == "<":
        break
    ans+=1
print(ans)

n = int(input())
s = input()

result = 0
for ch in s:
    if ch == '<':
        result += 1
    else:
        break

for ch in s[::-1]:
    if ch == '>':
        result += 1
    else:
        break

print(result)


n = int(input())
s = input()
ans = 0
i = n - 1
while i != -1 and s[i] == ">":
    ans += 1
    i -= 1
i = 0
while i != n and s[i] == "<":
    ans += 1
    i += 1
print(ans)

n = int(input() )
s = input()

pos = s.find("><")
if pos == -1 :
    print(n)
else :
    ans = 0
    for i in s :
        if i == '>' :
            break;
        else :
            ans += 1;
    for i in range(n-1,-1,-1) :
        t = s[i]
        if t=="<" :
            break;
        else :
            ans += 1;
    print(ans)

n,st = int(input()),input()

i = 0
ans = 0
while i<n and st[i] == '<':
    ans += 1
    i += 1

i = n-1
while i>=0 and st[i] == '>':
    ans += 1
    i -= 1

print(ans)


n = int(input())

s = input()

ans = 0

for c in s:
    if c == '<':
        ans += 1
    else:
        break

for c in reversed(s):
    if c == '>':
        ans += 1
    else:
        break

print(ans)


n = int(input())
l = input()
ans = 0
for i in range(n):
    if l[i] == '<':
        ans += 1
    else:
        break
for i in range(n - 1, -1, -1):
    if l[i] == '>':
        ans += 1
    else:
        break
print(ans)


n = int(input())
s = input()
count = 0
i = 0
while i < n and s[i] == '<':
    count += 1
    i += 1
i = n - 1
while i >= 0 and s[i] == '>':
    count += 1
    i -= 1
print(count)

__author__ = 'Think'
n=int(input())
bumpers=input()
total=0
for i in bumpers:
	if i=="<":
		total+=1
	else:
		break
for i in reversed(bumpers):
	if i==">":
		total+=1
	else:
		break
print(total)

#!/usr/bin/env python3

from sys import stdin


def main():
    n, = stdin_get_ints_from_line()
    s = stdin_get_string_from_line()

    res = 0

    for x in s:
        if x == '<':
            res += 1
        else:
            break

    for x in reversed(s):
        if x == '>':
            res += 1
        else:
            break

    print(res)
    return


def stdin_get_ints_from_line():
    return (int(x) for x in stdin.readline().strip().split(' '))


def stdin_get_ints_list_from_line():
    return list(int(x) for x in stdin.readline().strip().split(' '))


def stdin_get_string_from_line():
    return stdin.readline().strip()


def __starting_point():
    main()

__starting_point()

N = int(input())
listy = input()
count = 0
for x in listy:
	if x == '<':
		count += 1
	else:
		break
for x in listy[::-1]:
	if x == '>':
		count += 1
	else:
		break

print(count)

n = int(input())
p = 0;
s = input()
for i in range(len(s)):
    if s[i] == '<':
        p += 1;
    else:
        break;
for i in range(len(s)-1, -1, -1):
    if s[i] == '>':
        p += 1;
    else:
        break;
print(p);


n=int(input())
plateau=input()

i=0
while n>i and plateau[i]=="<":
    i+=1

j=n-1
while j>=0 and plateau[j]==">":
    j-=1

if i>j:
    print(n)
else:
    print(i+(n-1-j))


n = int(input());
s = input();

i = 0;
ans = 0;
while i < n and s[i] == "<":
    ans += 1;
    i += 1;

i = n - 1;
while i >= 0 and s[i] == ">":
    ans += 1;
    i -= 1;

print(ans);


input()

s = input()
first = s[0]
last = s[-1]
answ = 0
if first == '<':
    for i in range(len(s)):
        if s[i] == first:
            answ += 1
        else:
            break
if last == '>':
    for i in range(len(s)-1, -1, -1):
        if s[i] == last:
            answ += 1
        else:
            break

print(answ)


n = int(input())
bumps = input()

ans = 0

for i in range(n):
  if bumps[i] == ">":
    ans += i
    break
else:
  ans += n

for i in range(n):
  if bumps[n - 1 - i] == "<":
    ans += i
    break
else:
  ans += n

print(ans)

input()
n = input()
i = 0
k = 0
for i in range(len(n)):
    if n[i] == "<":
        k+=1
    else:
        break
for i in range(len(n) - 1, -1, -1):
    if n[i] == ">":
        k+=1
    else:
        break
print(k)

def main():
	n = int(input())
	s = input()
	count = 0
	i = 0

	while i < n and s[i] == '<' :
		count += 1
		i += 1

	i = n - 1
	while i > -1 and s[i] == '>':
		count += 1
		i -= 1

	print(count)


def __starting_point():
	main()
__starting_point()

import math
import sys

n = input()
n = int(n)
a = input()

count = 0
mcount = 0
for i in range(n):
    if (a[i] == '<'):
        count += 1
    else :
        break        

for i in range(n-1,-1,-1):
    if (a[i] == '>'):
        count += 1
    else :
        break


print (count)

import sys

n = int(input())
a = input()
if len(set(a)) == 1:
    print(n)
    return
res = 0
i = 0
while i < n and a[i] == '<':
    res += 1
    i += 1
i = n - 1
while i >= 0 and a[i] == '>':
    res += 1
    i -= 1
print(res)


n = int(input())
s = input()
if s[0] != '<' and s[-1] != '>':
    print(0)
elif s[0] != '<':
    if '<' in s:
        print(len(s) - s.rindex('<') - 1)
    else:
        print(len(s))
elif s[-1] != '>':
    if '>' in s:
        print(s.index('>'))
    else:
        print(len(s))
else:
    print(s.index('>') + len(s) - s.rindex('<') - 1)