# -*- coding: utf-8 -*-
import re
t = int(input())
for i in range(t):
    n = int(input())
    s = input()
    s = re.sub('>{2,100}', '>', s, 100)
    s = re.sub('<{2,100}', '<', s, 100)
    s = re.sub('><', '', s, 100)
    print(len(re.findall('<>', s)))
