s = input() c = s.count("c") - 1 w = s.count("w") print(min(c, w))