import strutils let S = stdin.readline echo(min(S.count('c') - 1, S.count('w')))