if __name__ == "__main__":
	tt = int(input())
	for _ in range(tt):
		n, s, i, j = int(input()), input(), 0, 0
		if s == '<>':
			print(1)
			continue
		for c in s:
			if c == '>':
				break
			i += 1
		for c in s[:-1]:
			if c == '<':
				break
			j += 1
		print(i if i < j else j)
			
