def main(): s = input() c = s.count("c") - 1 w = s.count("w") print(min(c, w)) if __name__ == '__main__': main()