import strutils let s = stdin.readLine cCnt = s.count('c') wCnt = s.len - cCnt echo min(cCnt - 1, wCnt)