2010-12-20 Codeforces Beta Round #47 B. Choosing Symbol Pairs Codeforces Choosing Symbol Pairs文字cの出現回数がx回ならばi,jの選び方はx2通り。 S = raw_input() print sum([S.count(c)**2 for c in set(S)])