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: EASY

Solutions:
n = int(input())
stro = input()
ans = 0
x = 0
while stro[x] == '<' and x <= n - 1:
	x += 1
	ans += 1
	if x == n - 1 and stro[x] == '<':
		ans += 1
		break
	if x >= n:
		break
x = 1
while stro[-x] == '>' and x <= n:
	x += 1
	ans += 1
	if x == n and stro[-x] == '>':
		ans += 1
		break
	if x > n:
		break
print(ans)


n = int(input())
s = input()
i = 0
while i < n and s[i] == '<':
	i += 1
j = n - 1
while j > -1 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()
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)


import sys
n = int(sys.stdin.readline())
field = sys.stdin.readline()
count = 0
for i in range(n):
	if field[i] == '<':
		count += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if field[i] == '>':
		count += 1
	else:
		break
print(count)


n = int(input())
S = input()
k = 0
v = 0
d = 0
for i in range(n):
	if S[i] == '<' and v == 0:
		k = k + 1
	else:
		v = 1
	if v == 1 and S[i] == '>':
		d = d + 1
	else:
		d = 0
print(d + k)


import sys, math
sys.setrecursionlimit(10 ** 8)
n = int(input())
s = input()
x = 0
(j, k) = (0, n - 1)
for i in range(n):
	if j <= k and s[j] == '<':
		x += 1
		j += 1
	elif j <= k and s[k] == '>':
		x += 1
		k -= 1
print(x)


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


nr_of_bumpers = int(input())
bumper_types = list(input())
fall_bumpers = 0
bumper_index = 0
while bumper_index < nr_of_bumpers and bumper_types[bumper_index] == '<':
	fall_bumpers += 1
	bumper_index += 1
bumper_index = nr_of_bumpers - 1
while bumper_index >= 0 and bumper_types[bumper_index] == '>':
	fall_bumpers += 1
	bumper_index -= 1
print(fall_bumpers)


import sys
import math
x = 0
l = int(input())
s = input()
i = 0
while i < l:
	if s[i] == '<':
		x += 1
		i += 1
	else:
		i = l
i = l - 1
while i >= 0:
	if s[i] == '>':
		x += 1
		i -= 1
	else:
		i = -1
print(x)
sys.exit()


N = int(input())
S = input()
ans = 0
i = 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)


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


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


a = int(input())
b = input()
tot = 0
if b[0] == '<':
	ind = b.find('>')
	if ind == -1:
		tot += a
	else:
		tot += b.find('>')
if b[-1] == '>':
	ind = a - b[::-1].find('<')
	if ind == a + 1:
		tot += a
	else:
		tot += a - ind
print(tot)


a = input()
bumpers = input()
counter = 0
for i in range(len(bumpers)):
	if bumpers[i] == '<':
		counter += 1
	else:
		break
for i in range(1, len(bumpers) + 1):
	if bumpers[-i] == '>':
		counter += 1
	else:
		break
print(counter)


from sys import stdin, stdout
n = int(stdin.readline().replace('\n', ''))
bumps = list(stdin.readline().replace('\n', ''))
total = 0
for bump in bumps:
	if bump == '<':
		total += 1
	else:
		break
for bump in bumps[::-1]:
	if bump == '>':
		total += 1
	else:
		break
stdout.write(str(total))


n = int(input())
s = input()
(ans, ans1) = (0, 0)
w = 0
if s[n - 1] == '>':
	x = s[::-1]
	t = 0
	for i in range(len(x)):
		if x[i] != '>':
			ans1 = i
			t = 1
			break
		elif i == len(s) - 1 and x[len(s) - 1] == '>' and (t == 0):
			ans1 = i + 1
if s[0] == '<':
	f = 0
	for i in range(len(s)):
		if s[i] != '<':
			ans = i
			f = 1
			break
		elif i == len(s) - 1 and s[len(s) - 1] == '<' and (f == 0):
			ans = i + 1
elif s[0] != '<' and s[len(s) - 1] != '>':
	print(0)
	w = 1
if w == 0:
	print(ans + ans1)


from sys import stdin

def solve(bumpers):
	result = 0
	for bumper in bumpers:
		if bumper == '<':
			result += 1
		else:
			break
	for bumper in reversed(bumpers):
		if bumper == '>':
			result += 1
		else:
			break
	return result
if True:
	next(stdin)
	print(str(solve(next(stdin).strip('\r\n'))))
else:
	bumpers = ['<<><', '>>>>>', '>><<', '', '<<>>', '><>', '>>>><', '><<<<']
	for test_word in bumpers:
		print(str(solve(test_word)))


import re
n = int(input())
s = input()
(prefix, ending) = (0, 0)
if s[0] == '<':
	prefix = len(re.findall('[<]+', s)[0])
if s[-1] == '>':
	ending = len(re.findall('[>]+', s[::-1])[0])
print(prefix + ending)


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


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)


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, 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()
count = 0
for l in s:
	if l == '<':
		count += 1
	else:
		break
for l in s[::-1]:
	if l == '>':
		count += 1
	else:
		break
print(count)


N = int(input())
Bumper = input()
Checked = [False for i in range(N)]
i = 0
while i < N and Bumper[i] == '<':
	Checked[i] = True
	i += 1
i = N - 1
while i >= 0 and Bumper[i] == '>' and (Checked[i] != True):
	Checked[i] = True
	i -= 1
print(Checked.count(True))


import sys
input = sys.stdin.readline
k = int(input())
n = input().strip()
counter = 0
for i in n:
	if i == '<':
		counter += 1
	else:
		break
for i in n[::-1]:
	if i == '>':
		counter += 1
	else:
		break
print(counter)


n = int(input())
bumpers = input()
a = n
for x in range(n):
	if bumpers[x] != '<':
		a = x
		break
bumpers = bumpers[::-1]
b = n
for x in range(n):
	if bumpers[x] != '>':
		b = x
		break
print(a + b)


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


__author__ = 'Alexander'
import sys
n = int(sys.stdin.readline().strip())
a = sys.stdin.readline().strip()
counter = 0
for i in range(len(a)):
	if a[i] == '<':
		counter += 1
	else:
		break
for i in range(1, len(a) + 1):
	if a[-i] == '>':
		counter += 1
	else:
		break
sys.stdout.write(str(counter))


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


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


n = int(input())
s = input()
t = '<'
for x in range(n):
	if t != s[x]:
		break
else:
	x += 1
s = s[::-1]
t = '>'
for y in range(n):
	if t != s[y]:
		break
else:
	x += 1
print(x + y)


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()
main()


import math
answ = 0
b = input()
a = input()
count_1_total = a.count('<')
count_2_total = a.count('>')
count_1 = count_2 = 0
for i in range(len(a)):
	if a[i] is '<':
		count_1 = count_1 + 1
		if abs(count_1 - count_2) >= i + 1:
			answ = answ + 1
	elif a[i] is '>':
		count_2 = count_2 + 1
		if abs(count_1_total - count_1 - (count_2_total - count_2 + 1)) >= len(a) - i:
			answ = answ + 1
print(answ)


n = int(input())
s = input()
res = 0
for c in s:
	if c == '<':
		res += 1
	else:
		break
for c in s[::-1]:
	if c == '>':
		res += 1
	else:
		break
print(res)


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


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()
cnt = 0
for i in s:
	if i != '<':
		break
	cnt += 1
for i in s[::-1]:
	if i != '>':
		break
	cnt += 1
print(cnt)


i = int(input())
c = input()
n = 0
for j in c:
	if j == '<':
		n += 1
	else:
		break
j = len(c) - 1
while j > -1:
	if c[j] == '>':
		n += 1
		j -= 1
	else:
		break
print(n)


__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)


n = int(input())
b = str(input().strip())
count = 0
left_end = -1
for i in range(len(b)):
	if b[i] == '<':
		count += 1
		left_end = i
	else:
		break
for i in range(len(b) - 1, -1, -1):
	if b[i] == '>' and i > left_end:
		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())
bumpers = input()
leftCount = 0
for n in range(0, len(bumpers)):
	if bumpers[n] is '<':
		leftCount += 1
	else:
		break
rightCount = 0
for n in range(len(bumpers) - 1, -1, -1):
	if bumpers[n] is '>':
		rightCount += 1
	else:
		break
print(rightCount + leftCount)


n = int(input())
s = str(input())
ans1 = 0
ans2 = 0
i = 0
while s[i] == '<' and i < n:
	ans1 += 1
	i += 1
	if i == n:
		break
i = n - 1
while s[i] == '>' and i >= 0:
	ans2 += 1
	i -= 1
	if i == -1:
		break
print(min(n, ans1 + ans2))


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
n = ii()
s = input()
ans = 0
i = 0
while i < n and s[i] == '<':
	ans += 1
	i += 1
i = n - 1
while i > -1 and s[i] == '>':
	ans += 1
	i -= 1
print(ans)


n = int(input())
t = input()
d = {'<': 0, '>': 0}
count = 0
for i in range(n):
	if t[i] == '<':
		count = count + 1
	else:
		break
for i in range(n - 1, -1, -1):
	if t[i] == '>':
		count = count + 1
	else:
		break
print(count)


n = int(input())
a = list(input())
left = 0
right = 0
for i in range(0, n):
	if a[i] == '<':
		left += 1
	else:
		break
for i in reversed(range(0, n)):
	if a[i] == '>':
		right += 1
	else:
		break
print(left + right)


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


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


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


n = int(input())
data = [i for i in input()]
ret = 0
ind = 0
if data[ind] == '<':
	while 1:
		if ind < n and data[ind] == '<':
			ret += 1
			ind += 1
		else:
			break
ind = n - 1
if data[ind] == '>':
	while 1:
		if ind > -1 and data[ind] == '>':
			ret += 1
			ind -= 1
		else:
			break
print(ret)


def main():
	num = input()
	signal = list(input())
	len_signal = len(signal)
	if signal[0] == '<':
		try:
			left_num = signal.index('>')
		except ValueError:
			return len_signal
	else:
		left_num = 0
	signal.reverse()
	if signal[0] == '>':
		try:
			right_num = signal.index('<')
		except ValueError:
			return len_signal
	else:
		right_num = 0
	return left_num + right_num
print(main())


n = int(input())
letts = input()
tot = 0
for i in range(n):
	if letts[i] != '<':
		break
	tot += 1
cur = tot
for i in range(n - cur):
	if letts[n - i - 1] != '>':
		break
	tot += 1
print(tot)


(n, seq) = (int(input()), input())
(idx, ans) = (0, 0)
while idx < n and seq[idx] == '<':
	ans += 1
	idx += 1
idx = n - 1
while idx > -1 and seq[idx] == '>':
	ans += 1
	idx -= 1
print(ans)


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


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, sys, re, itertools, pprint
(ri, rai) = (lambda : int(input()), lambda : list(map(int, input().split())))
n = ri()
a = input()
res = 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)


input()
s = input()
j = 0
while j < len(s) and s[j] == '<':
	j += 1
k = len(s) - 1
while k >= 0 and s[k] == '>':
	k -= 1
print(j + len(s) - k - 1)


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())
directions = input()
tempcount = 0
for i in range(n):
	if directions[i] == '<':
		tempcount += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if directions[i] == '>':
		tempcount += 1
	else:
		break
print(tempcount)


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


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


n = int(input())
w = input()
c = 0
for i in w:
	if i == '<':
		c = c + 1
	else:
		break
n = n - 1
while n >= 0:
	if w[n] == '>':
		c = c + 1
		n = n - 1
	else:
		break
print(c)


n = int(input(''))
p = input('')
i = 0
j = n - 1
ans = 0
ans = int(ans)
a = '<'
b = '>'
while p[i] == a:
	i = i + 1
	if i == n:
		ans = ans + 1
		break
	ans = ans + 1
while p[j] == b:
	j = j - 1
	if j < 0:
		ans = ans + 1
		break
	ans = ans + 1
print(ans)


n = int(input())
s = input()
begin = True
counter = 0
ans = 0
for i in range(n):
	if begin and s[i] == '<':
		ans += 1
	elif s[i] == '>':
		counter += 1
		begin = False
	else:
		counter = 0
print(ans + counter)


def pinball(n, s):
	(result, i) = (0, 0)
	while i < n and s[i] == '<':
		result += 1
		i += 1
	i = n - 1
	while i >= 0 and s[i] == '>':
		result += 1
		i -= 1
	return result
m = int(input())
t = input()
print(pinball(m, t))


n = int(input())
s = input()
ind1 = 0
ind2 = n - 1
cont = 0
while s[ind1] == '<':
	cont += 1
	ind1 += 1
	if ind1 == n:
		break
while s[ind2] == '>' and ind2 >= 0:
	cont += 1
	ind2 -= 1
print(cont)


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


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()
wyn = 0
l = 0
while l < n:
	if s[l] == '<':
		wyn += 1
		l += 1
	else:
		break
l = n - 1
while l >= 0:
	if s[l] == '>':
		wyn += 1
		l -= 1
	else:
		break
print(wyn)


num = int(input())
bumper = str(input())
bumperlist = list(bumper)
fallright = 0
fallleft = 0
for i in range(num):
	if bumperlist[i] == '<':
		fallleft += 1
	else:
		break
for i in reversed(range(num)):
	if bumperlist[i] == '>':
		fallleft += 1
	else:
		break
print(str(fallright + fallleft))


import sys
import math
import bisect

def solve(s):
	n = len(s)
	ans = 0
	for i in range(n):
		if s[i] == '<':
			ans += 1
		else:
			break
	for i in range(n - 1, -1, -1):
		if s[i] == '>':
			ans += 1
		else:
			break
	return ans

def main():
	n = int(input())
	s = input()
	ans = solve(s)
	print(ans)
main()


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


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)


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)


import fileinput
num_args = 2
fall = 0
i = 0
for arg in range(num_args):
	if arg == 0:
		n = int(input())
	else:
		bumpers = input()
j = len(bumpers) - 1
while i <= len(bumpers) - 1 and bumpers[i] == '<':
	i += 1
	fall += 1
while j >= 0 and bumpers[j] == '>':
	j -= 1
	fall += 1
print(fall)


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


def solve():
	n = int(input())
	s = input()
	c = 0
	for ch in s:
		if ch == '<':
			c += 1
		else:
			break
	for ch in s[::-1]:
		if ch == '>':
			c += 1
		else:
			break
	print(c)
solve()


n = int(input())
stri = input()
sums = 0
n = len(stri)
i = 0
while stri[i] == '<':
	sums += 1
	i += 1
	if i == n:
		break
i = n - 1
while stri[i] == '>':
	sums += 1
	i -= 1
	if i == -1:
		break
print(sums)


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


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)


import sys
import math
input()
ar = list(input())
suma = 0
ar = ar + ['?']
for (n, i) in enumerate(ar):
	if i != '<':
		suma += n
		break
ar = ar[:len(ar) - 1]
ar = ['?'] + ar
ar = reversed(ar)
for (n, i) in enumerate(ar):
	if i != '>':
		suma += n
		break
print(suma)


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())
a = list(input())
count = 0
i = 0
while i != n:
	if a[i] == '<':
		count += 1
	else:
		break
	i += 1
if i != n:
	i = n - 1
	while i != -1:
		if a[i] == '>':
			count += 1
		else:
			break
		i -= 1
print(count)


__author__ = 'artyom'

def main():
	n = read()
	s = read(0)
	c = 0
	while c < n and s[c] == '<':
		c += 1
	n -= 1
	while n >= 0 and s[n] == '>':
		n -= 1
		c += 1
	return c

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s)
write(main())


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)


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


a = int(input())
st = [x for x in input()]
total = 0
j = 0
while j <= len(st) - 1:
	if st[j] == '<':
		total += 1
		j += 1
	else:
		break
j = len(st) - 1
while j >= 0:
	if st[j] == '>':
		total += 1
		j -= 1
	else:
		break
print(total)


n = int(input())
s = input()
qt = 0
qb = 0
while s[n - qb - 1] == '>':
	qb += 1
	if qb == n:
		break
while s[qt] == '<':
	qt += 1
	if qt == n:
		break
print(qt + qb)


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


n = int(input())
s = input()
t_l = 0
t_r = 0
for c in s:
	if c == '<':
		t_l += 1
	else:
		break
for c in s[::-1]:
	if c == '>':
		t_r += 1
	else:
		break
print(t_l + t_r)


n = int(input())
line = str(input())
num = 0
for it in line:
	if it == '<':
		num += 1
	else:
		break
for it in line[::-1]:
	if it == '>':
		num += 1
	else:
		break
print(num)


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


n = int(input())
bumpers = input()
izquierda = 0
derecha = 0
i = 0
while i < n:
	if bumpers[i] == '<':
		izquierda = izquierda + 1
	else:
		break
	i = i + 1
i = 0
while i < n:
	if bumpers[n - i - 1] == '>':
		derecha = derecha + 1
	else:
		break
	i = i + 1
respuesta = izquierda + derecha
print(respuesta)