import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { String S = scan.nextLine(); int count = 0; int ans = 0; for(int i=S.length()-1; i>=0; i--) { if(S.charAt(i) == 'w') { count++; } else if(S.charAt(i) == 'c') { ans += count * (count-1) / 2; } } System.out.println(ans); } } }