t = int(input())
for _ in range(t):
    strings = set()
    n = int(input())
    a = list(map(int, input().split()))
    for x in a:
        strings.add((x-1)//10)
    print(len(strings))
