"""609C"""
# import math
# import sys
def  main():
	n = int(input())
	string = str(input())
	cnt = 0
	for i in range(n-1):
		if string[i]=='<' and string[i+1]=='>':
			cnt+=1
	print(cnt)
	return

# main()
def test():
	t = int(input())
	while t:
		main()
		t-=1
test()
