s=input() line=list(s) c_count=line.count("c") w_count=line.count("w") if w_count<=c_count: print(w_count) else: print(c_count-1)