S = input() pos_c_start = S.find("cw") count_w = S.count('w') print(min(pos_c_start, count_w))