import sequtils,strutils var S = stdin.readline cntw,cntc,cnt : int for s in 1..S.len: if S[^s] == 'c': cntc += 1 cnt += cntw * (cntw - 1) div 2 elif S[^s] == 'w': cntw += 1 echo cnt