#!/usr/bin/python -tt
def main():
    t=input()
    for T in range(t):
        count=0
        d={}
        string=raw_input()
       
        for i in string:
            if i in d:
                del d[i]
            else:
                d[i]=0;
                count=count+1
        print count

main()

8f8a645db33f3240966975a152775b6a4fa940a5
#!/usr/bin/python -tt
def main():
    t=input()
    for T in range(t):
        count=0
        d={}
        string=raw_input()
       
        for i in string:
            if i in d:
                del d[i]
            else:
                d[i]=0;
                count=count+1
        print count

main()
