<reponame>shihab4t/Competitive-Programming<filename>Online-Judges/DimikOJ/Python/07-count-number.py
for _ in range(int(input())):
    n = input()
    count_n = 0
    for i in range(len(n)):
        if n[i] == " ":
            count_n += 1  
    print(count_n+1)

for _ in range(int(input())):
    n = input()
    count_n = 0
    for i in range(len(n)):
        if n[i] == " ":
            count_n += 1  
    print(count_n+1)