p[9],i,s;main(c){for(;i++%10<8?c=~getchar():!p[c=i%2+1]?:!(p[c]=!printf("%d\n",s+=p[c]));)p[3+c/44]++;}