#include <bits/stdc++.h>
using namespace std;

#define ll long long int 

int main() {
	string s;
	getline(cin,s);
	// string of 'x' and 'y'
	// possible operations => (xy - yz) and (yx - zy)
	
	// first count occurences of x
	ll count=0;
	for(char c:s){
		if(c=='x')count++;
	}
	
	// now check if 'yy' present or not
	if(s.find("yy")!=string::npos){
		cout << count;
		return 0;
	}
	else{
		// we need to subtract length of smallest x block from count value
		int blockSize=0;
		int minSize=1e9;
		for(int i=0;i<s.length();i++){
			if(s[i]=='x')blockSize++;
			else{
				minSize = min(minSize,blockSize);
				blockSize=0;
			}
		}
		minSize = min(minSize,blockSize);
		cout << count-minSize;
	}
	return 0;
}