You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a row, the system considers that the file content does not correspond to the social network topic. In this case, the file is not sent and an error message is displayed.Determine the minimum number of characters to remove from the file name so after that the name does not contain "xxx" as a substring. Print 0 if the file name does not initially contain a forbidden substring "xxx".You can delete characters in arbitrary positions (not necessarily consecutive). If you delete a character, then the length of a string is reduced by $$$1$$$. For example, if you delete the character in the position $$$2$$$ from the string "exxxii", then the resulting string is "exxii".

The first line contains integer $$$n$$$ $$$(3 \le n \le 100)$$$ — the length of the file name. The second line contains a string of length $$$n$$$ consisting of lowercase Latin letters only — the file name.

Print the minimum number of characters to remove from the file name so after that the name does not contain "xxx" as a substring. If initially the file name dost not contain a forbidden substring "xxx", print 0.

NoteIn the first example Polycarp tried to send a file with name contains number $$$33$$$, written in Roman numerals. But he can not just send the file, because it name contains three letters "x" in a row. To send the file he needs to remove any one of this letters.

#include <iostream>
#include <string>

   using namespace std;

int main() {
	int n, k, sum;
	bool flag = false;
	string s;
	cin >> n >> s;
	s += " ";
	k = sum = 0;
	for (int i = 0; i < n; i++) {
		if (i + 1 < n && (s[i] == 'x') && (s[i+1] == s[i])) {
			k++;
		} else {
			if (k >= 0) {
				++k;
				if (k >= 3) {
					sum += (k - 2);
					flag = true;
				}
			}
			k = 0;
		}
	}
	if (flag) {
	    cout << sum << "\n";
	} else {
		cout << 0 << "\n";
	}
return 0;
}

#include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
/*inline char gc(){
	static char buf[1<<14],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<14,stdin),p1==p2)?EOF:*p1++;
}*/
#define dd c=getchar()
inline ll read(){
	ll x=0,f=1;char dd;
	for(;!isdigit(c);dd){if(c=='-')f=-1;if(c==EOF)return EOF;}
	for(;isdigit(c);dd)x=(x<<1)+(x<<3)+(c^48);return x*f;
}
#undef dd
inline void write(ll x){
	if(x<0)putchar('-'),x=-x;
	if(x>9)write(x/10);putchar(x%10|48);
}
const ll N=100;
ll n,tot,ans;char a;
int main(){
	for (ll n=read();n;--n){
		cin>>a;
		if (a=='x') ++tot;else tot=0;
		if (tot>2) tot=2,++ans;
	}write(ans);
	return 0;
}

#include <iostream>

using namespace std;

int main(){
	int n , brojac=0 , brojac1=0;
	char a;
	cin>>n;
	for (int i=0;i<n;i++)
	{
		cin>>a;
		if (a=='x') brojac++;
		else brojac=0;
		if (brojac>=3) brojac1++;
	}

	cout<<brojac1;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    int currlen =0; char c; int res=0;
    for(int i=0; i<n; i++){
        cin >> c;
        if(c=='x')
            currlen++;
        else
            res += max(currlen-2, 0), currlen=0;
    }
    res+= max(currlen-2, 0);
    cout<<res<<endl;
}

#include<stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
char s[105];
int main()
{
    int n;
    scanf("%d", &n);
    getchar();
    scanf("%s", s);
    int ans = 0, x = 0;
    for(int i = 0; i < n; i++)
    {
        //printf("%c", s[i]);
        if(s[i] != s[i - 1] && i)
        {
            //printf("%d ", x);
            if(x >= 3)
                ans += (x - 2);
            x = 0;
        }
        if(s[i] == 'x')
        {
            x++;
        }
    }
    //printf("%d", x);
    if(x >= 3)
        ans += (x - 2);
    printf("%d", ans);
    return 0;
}
//2019-07-21 19:34:04.036

#include<iostream>
#include<stack>
#include<deque>
#include<queue>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<string>
#include<set>
using namespace std;
int main()
{
	int x, c = 0;
	cin >> x;
	string s;
	cin >> s;
	while (s.find("xxx")<s.size())
	{
		c++;
		s.erase(s.find("xxx"), 1);
	}
	cout << c << "\n";
}

// Example program
#include <iostream>
#include <string>
using namespace std;
int main()
{
string x,j;
int n,f=0,l=0;
cin>>n;
cin>>j;
for (int d=0; d<n;d++)
if (j[d]=='x')
f++;
else {
    if (f>=3)
    l=l+f-3+1;
    f=0;

}
if(f>=3)
l=l+f-3+1;
    cout<<l;
}

#include <iostream>
using namespace std;
int main()
{
    int a,c=0;
    cin>>a;
    string b;
    cin>>b;
    for(int u=0 ; u<=(a-3);u++)
    {if(b[u]=='x' && b[u+1]=='x' && b[u+2]=='x')
    {c++;}}
    cout<<c;
    return 0;
}

#include <iostream>

int main()
{
	int n, num = 0;
	char* str;

	std::cin >> n;

	str = new char[n];

	int counter = 0;
	for (int i = 0; i < n; i++)
	{
		std::cin >> str[i];

		if (str[i] == 'x')
			counter++;
		else
			counter = 0;

		if (counter > 2)
			num++;
	}

	delete[] str;

	std::cout << num;

	return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	int i, j, k;
	char a[105];
	int countn1, countn2;
	while (cin >> n)
	{
		for (i = 0; i < n; i++) cin >> a[i];
		countn1 = 0, countn2 = 0;
		for (i = 0; i < n; i++)
		{
			if (a[i] == 'x') countn1++;
			else countn1 = 0;
			if (countn1 >= 3) countn2++;
		}
		cout << countn2 << endl;
	}
	return 0;
}

#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
int b,n;
cin>>b>>s;
for(int i=0;i<s.size();i++)
if(s[i]=='x'&&s[i+1]=='x'&&s[i+2]=='x')
{n++;}
cout<<n;
     }

#include <iostream>
#include <string>
using namespace std;

int main() {
	int n,i=0,p=0,m=0;
	string s;
	cin>>n>>s;
	while (n--) {
	    if (s[i]=='x') {m++; i++;}
	    else if (m>2) {p+=m-2; m=0; i++;}
	        else {m=0; i++;}
	    if (!n && m>2) p+=m-2;

	}

	cout<<p;
}

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

int main(){

    int num;
    cin >> num;
    int cont = 0;
    string cad;
    cin >> cad;
     int cont_res = 0;
     int res = 0;
    for( int i = 0; i < num; i++){
        if(cad [i] == 'x' && cad[i+1] == 'x' && cad[i+2] == 'x'){
            cont++;
            //cout << cad[i] << " " << cad[i+2] << " cont = " << cont<< endl;
            if (cont >1){
                res = cont;
            }else{
                res = 1;
            }
        }
    }

    //int res = 0;
    if(cad[0] == 'x' && cad[2] != 'x'){
        cout << 0 << endl;
    }else{
        cout << res << endl;
    }
}

#include<bits/stdc++.h>
using namespace std;
int ans;
char a[102];
int main()
{
	int n;
	cin>>n>>a;
	for(int i=2;i<n;i++)
	{
		if(a[i]=='x'&&a[i-1]=='x'&&a[i-2]=='x')
			ans++;
	}
	cout<<ans;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,t,c=0,d=0;
    string s;
    cin>>n;
    cin>>s;
    for(int i=0; i<s.size(); i++)
    {

        if(s[i]=='x')
        {
            c++;
            if(i==s.size()-1)
            {
                if(c>=3)
                d=d+(c-2);
            }
        }
        else if(s[i]!='x')
        {
            if(c>=3)
            {

                d=d+(c-2);
            }
            c=0;
            continue;

        }
    }
    if(c==s.size())
    {
        cout<<c-2<<endl;
    }
    else
        cout<<d<<endl;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
    ll i,j,n,m,ans,sum=0,temp,diff,count=0,test,x,y,len;
    string str1,str2;
    cin>>n;
    cin.ignore();
    getline(cin,str1);
    for(i=0;i<n;i++)
    {
        if(str1[i]=='x')
        {
            count++;
        }
        else if(str1[i]!='x')
        {
            if(count>2){sum=sum+count-2;}
            count=0;
        }
    }
    if(count>2)
    {
        sum=sum+count-2;
    }
    cout<<sum<<endl;
}

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<set>
using namespace std;
int main()
{
	int n; char s[110];
	cin >> n;
	cin >> s;
	int t = 0, c = 0;
	for (int i = 0; i < n; i++)
	{
		if (s[i] == 'x')
			t++;
		if (s[i] != 'x')
			t = 0;
		if (t == 3)
		{
			t = 2;
			c++;
		}
	}
	cout << c << endl;
	return 0;
}

#include<iostream>
#include<string>
#include<algorithm>
#include<set>
using namespace std ;
void main()
{
	int n;
	cin>>n;
	int k=0;
	int counter=0;
	int con=0;
	char a[100];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];

	}
	for(int i=0;i<n;i++)
	{

		if(a[i]=='x')
		{
		counter++;

		}
		else
		{
			counter=0;
			continue;

		}
		if(counter>=3)
		{
			con++;

		}
	}

cout<<con<<endl;
}

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	s = "xxx" + string("$") + s;
	vector<int> z;
	z.resize(s.length());
	z[0] = 0;
	int c = 0;
	for (int i = 1; i < s.length(); i++)
	{
		while (i < s.length() && s[z[i]] == s[z[i] + i])
			z[i]++;
		if (z[i] == 3)
			c++;
	}
	cout << c;
}

#include <bits/stdc++.h>
using namespace std;
int l, ans;
string s;
int main() {
    cin >> l >> s;
    for (int i = 0, cnt = 0; i < l; ++i) {
        if (s[i] == 'x') {
            ++cnt;
            if (cnt == 3) {
                while (s[i] == 'x') {
                    s[i] = '0';
                    ++i;
                    ++ans;
                }
                cnt = 0;
            }
        } else {
            cnt = 0;
        }
    }
    cout << ans << endl;
    return 0;
}

#include <iostream>
#include <vector>
using namespace std;

int main () {

    int n, count = 0, ans = 0;
    string in;
    cin >> n >> in;

    for (int i = 0; i < in.size(); i++) {
        if (in[i] == 'x') {
            count++;
        } else {
            if (count > 2)
                ans += count - 2;
            count = 0;
        }
    }
    if (in[in.size() - 1] == 'x')
        if (count > 2)
            ans += count - 2;

    cout << ans << endl;

    return 0;
}

#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
int n,num=0,ans=0;
char book[105];
int main()
{
	cin>>n;
	cin>>book;
	for(int i=0;i<n;i++)
	{
		if(book[i]=='x')
			num++;
		else
		{
			if(num>=3)
				ans+=num-2;
			num=0;
		}
		if(i==n-1)
		{
			if(num>=3)
				ans+=num-2;
		}
	}
	cout<<ans;

	return 0;
 }

#include <iostream>

using namespace std;

int main()
{
	int n, sum=0;
	char let[100]={};
	cin>>n;
	for(int i=0; i<n; ++i)
	{
		cin>>let[i];
	}
	for(int i=0; i<n; ++i)
	{
		if((let[i]=='x')&&(let[i+1]=='x')&&(let[i+2]=='x'))
		{
			sum++;
		}
	}
	cout<<sum;
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
  int k,n,i,j=0,x;
  string s;
  cin>>k;
  cin>>s;
 // if(s.find("xxx")==4294967295) cout<<0; else
  //  {
    i=0;
  while(i<k)
   {

       x=s.find("xxx");
       if(s.find("xxx")==4294967295)break; else{

       s[x]='*'; j++;
   // cout<<s;

       i=x+1;

       }

       }
cout<<j;
   }

#include<bits/stdc++.h>
#define yoo long long int
using namespace std;
int main()
{
	int n;
	cin>>n;
	string s;
	cin>>s;
	int c=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='x' && s[i+1]=='x' && s[i+2]=='x')
		{
			c++;
		}
	}
	cout<<c<<endl;
}

#include <iostream>
using namespace std;
int main(){
int n, k=0;
string s,q="xxx";
cin>>n>>s;
int i=0;
while(true){
	if(s.length()<3) {cout<<k; return 0;}
	if(s.substr(i,3)==q) { k++; if(s.length()==3) {cout<<k; return 0;}
	s.erase(0,i+3);
	for(int j = 0;j < s.length();j++){
		if(s[j]=='x') {k++; if(j==s.length()-1){cout<<k; return 0;	} 	}
		else {s.erase(0,j+1); j=s.length(); i=-1;}
			}
		}
	i++;
	if(i==s.length()-1){cout<<k; return 0;	}
	}
cout<<k;
}

#include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i=0,k=0,jk=0,x=0;
    cin>>n;
    string s;
    cin>>s;
    int z[n]={1};
    for(i=0;i<n;i++)
    {
        z[i]=1;
    }
    for(i=0;i<n-1;i++)
    {
        if(s[i]=='x' && s[i+1]=='x')
        {
            z[k]++;
        }
        if(s[i+1]!='x')
        {
            k++;
        }
    }
    cout<<endl;
    for(i=0;i<k+1;i++)
    {
        if(z[i]>2)
        {
            jk=jk+z[i]-2;
        }
    }
    cout<<jk;
    return 0;
}

#include<bits/stdc++.h>

#define x first

#define y second

#define eps 1e-7

#define pb push_back

#define inf 0x3f3f3f3f

#define mod 1000000007

#define sq(x) ((x)*(x))

#define cb(x) ((x)*(x)*(x))

#define bit(x, y) (((x)>>(y))&1)

#define bctz(x) (__builtin_ctz(x))

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzl(x))

#define bctzl(x) (__builtin_ctzl(x))

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define pi 3.1415926535897932384626433832795

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

using namespace std;

typedef double DO;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

template<typename T, typename U> inline void smin(T &a, U b) {if(a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if(a<b) a=b;}

template <class T> inline void gn(T &x) {char c, sg=0; while(c=getchar(), (c>'9' || c<'0') && c!='-'); for((c=='-' ? sg=1, c=getchar() : 0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0'; if(sg) x=-x;}

template <class T1, class T2> inline void gn(T1 &x1, T2 &x2) {gn(x1), gn(x2);}

template <class T1, class T2, class T3> inline void gn(T1 &x1, T2 &x2, T3 &x3) {gn(x1, x2), gn(x3);}

template <class T1, class T2, class T3, class T4> inline void gn(T1 &x1, T2 &x2, T3 &x3, T4 &x4) {gn(x1, x2), gn(x3, x4);}

template <class T> inline void print(T x) {if(x<0) {putchar('-'); return print(-x);} if(x<10) {putchar('0'+x); return ;} print(x/10); putchar(x%10+'0');}

template <class T> inline void println(T x) {print(x); putchar('\n');}

template <class T> inline void printsp(T x) {print(x); putchar(' ');}

template <class T1, class T2> inline void print(T1 x1, T2 x2) {printsp(x1), println(x2);}

template <class T1, class T2, class T3> inline void print(T1 x1, T2 x2, T3 x3) {printsp(x1), printsp(x2), println(x3);}

template <class T1, class T2, class T3, class T4> inline void print(T1 x1, T2 x2, T3 x3, T4 x4) {printsp(x1), printsp(x2), printsp(x3), println(x4);}

int power(int a, int b, int m, int ans=1) {

	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;

	return ans;

}

#define NN 110

char s[NN];

int main() {

#ifndef	ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

#endif

	int n;

	scanf("%d %s", &n, s);

	int ans=0;

	for(int i=0, j=0; i<n; i=j) {

		for(j=i+1; j<n && s[i]==s[j]; j++) ;

		if(s[i]=='x' && j-i>2) ans+=j-i-2;

	}

	println(ans);

}

#include<bits/stdc++.h>
using namespace std;
string n;
long long ans,a;
int main(){
	cin>>a>>n;
	while(n.find("xxx")!=-1){
		n.erase(n.find("xxx"),1);
		ans++;
	}
	cout<<ans<<endl;
}

#include <iostream>
#include <string>
// #include <cstdlib>
// #include <cmath>
#include <array>
// #include <vector>
// #include <algorithm>
// #include <set>
// #include <map>

using namespace std;

int main(){
	int n;
	cin >> n;

	string error;
	cin >> error;

	int remove_x = 0;
	int xcnt = 0;

	for(int i = 0; i < n; i++){
		if(error[i] == 'x'){
			xcnt++;
		}
		else{
			// cout << "x=" << xcnt << endl;
			if(xcnt >= 3){
				remove_x += (xcnt - 2);
			}
			xcnt = 0;
		}

	}
	if(xcnt >= 3){
		remove_x += (xcnt - 2);
	}
	cout << remove_x << endl;
}

#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define INF 0x3f3f3f3f3f3f3f3fLL

#define mod 1000000007

#define hmod 911382323

#define pb push_back

#define sq(x) ((x)*(x))

#define sz(a) ((int)a.size())

#define LEN(a) (a.length())

#define x first

#define y second

#define ls (u<<1)

#define rs (ls + 1)

#define mid (st + ed >> 1)

#define eps 1e-8

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define rands(n) (rand()%n+1)

#define rand0(n) (rands(n)-1)

#define Rands(n) ((INT)rand()*rand()%n+1)

#define Rand0(n) (Rands(n)-1)

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

#define rep(i, a, b) for(int i=a; i<b; i++)

#define eprintf(...) fprintf(stderr, __VA_ARGS__)

#define shit(a) (1 << (a))

#define all(a) ((a).begin(), (a).end())

#define rev(a) (power(a, mod-2, mod))

#define add_edge(u, v) {nxt[E]=head[u];to[E]=v;head[u]=E++;}

#define init_edge(n) {memset(head, -1, sizeof head);E=0;}

#define input_tree {int n;cin>>n;init_edge(n); for(int i=0, u, v; i<n-1; i++) {gn(u); gn(v); add_edge(u,v); add_edge(v,u);}}

#define ADD(u, v) {u+=v;u%=mod;}

using namespace std;

typedef long long INT;

typedef unsigned long long UINT;

typedef unsigned int uint;

typedef complex<double> Complex;

typedef double DO;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<INT, INT> PII;

typedef pair<pii, int> ppi;

typedef pair<int, pii> pip;

typedef pair<DO, DO> pdd;

typedef pair<int, DO> pid;

typedef pair<DO, int> pdi;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<class T>inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}

template<class T>inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}

template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}

template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}

int power(int a, int b, int m, int ans=1) {

	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;

	return ans;

}

inline uint myrand(int n) {

	uint u = rand()%n;

	int c = rand()%10;

	u ^= u << c;

	u^=(u<<7)&263692864;

	u^=(u<<15)&402273075;

	u%=n;

	return u;

}

char s[111];

int main() {

#ifndef ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

	int _time=clock();

#endif

	int ans=0;

	int n;

	cin >> n;

	scanf("%s", s);

	int cnt=0;

	for(int i=0; i<n; i++) {

		if(s[i] == 'x') cnt++;

		else cnt=0;

		if(cnt>=3) ans++;

	}

	cout << ans << endl;

#ifndef ONLINE_JUDGE

	cerr<<"The running time is : " << (DO)(clock()-_time) / CLOCKS_PER_SEC<<endl;

#endif

	return 0;

}

#include<iostream>
using namespace std;
int main()
{
    int a,i,j=0,k=0,res,x;
    string b;
    cin>>a>>b;
    for(i=0;i<a;i++)
    {
        if(b[i]=='x'){j++;}
        else{if(j>2){k+=(j-2);}j=0;}
    }
    x=j;res=k;
    if(x>2){res+=x-2;}
    cout<<res;
}

#include <bits/stdc++.h>

using namespace std;

char s[110];

int main() {

#ifndef ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

#endif

	int n;

	scanf("%d",&n);

	scanf("%s",s);

	int sum=0;

	int num=0;

	for(int i=0;i<=n;i++){

		if(s[i]=='x') sum++;

		else {

			if(sum>2) num+=(sum-2);

			sum=0;

		}

	}

	printf("%d",num);

	return 0;

}

#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
 int main(){
 	int size;
 	cin >> size;
 	string word;
 	cin >> word;
 	int total = 0;
 	const char *arr = word.c_str();
 	char last = arr[0];
 	int count = 0;
	for (int i = 0; i < size; ++i){
		if(last == arr[i] && last == 'x'){
			count++;
			if(count==3){
				count--;
				total++;
			}
		}else{
			count = 1;
		}
		last = arr[i];
	}
	cout << total << endl;
 	return 0;
 }

#include <iostream>
#include <string>
using namespace std;

int main()
{
	char a[102];
	int n, s = 0, m = 0; cin >> n; cin.ignore();
	cin.getline(a, n + 1);
	for (int i = 0; i < n; i++)
	{
		if (a[i] != 'x')
		{
			s = 0; continue;
		}
		else s++;
		if (s == 3)
		{
			m++;
			if (a[i + 1] == 'x') s = 2; else s = 0;
		}
	}
	cout << m;
}

#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <cstdlib>
#include <algorithm>

using namespace std;

int main()
{
    int n,cont = 0,total = 0;cin>>n;
    string a;cin>>a;
    for(int i = 0;i < n-1;i++)
    {
        if(a[i] == 'x' && a[i+1]=='x')
        {
            cont++;
            if(i+1 ==n-1)
                total+=cont-1;
        }
        else if(a[i] == 'x' && a[i+1] !='x')
        {
            cont++;
            if(cont > 1)
            {
                total+=(cont-2);
            }
            cont = 0;
        }

    }
    cout<<total;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    cin.sync_with_stdio(0);
    cin.tie(0);

    int n, xxx = 0;
    string file;
    cin >> n >> file;

    for (int i = 0; i < n - 2; i++)
    {
        if (file.substr(i, 3) == "xxx") ++xxx;
    }

    cout << xxx << '\n';
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n, cnt=0 ,tot=0; string x;
  cin>>n; cin>>x;
  for(int i=0 ; i<n ; i++)
  {
      if(x[i]=='x')
      {
          cnt++;

      }
      else
        {

      cnt=0;
        }
        if(cnt>2)
            {tot+=cnt-2; cnt-=(cnt-2);}
  }

  cout<<tot;

    return 0;
}

#include<bits/stdc++.h>
using namespace std ;
int n,i,cnt;
char str[101];

int main(){

cin>>n;
for(i=0;i<n;++i)
    cin>>str[i];

for(i=0;i<n;++i){
    if(i+2<=n-1){
        if(str[i]=='x' && str[i+1]=='x'&& str[i+2]=='x'){
            cnt++;
        }
    }}
    cout<<cnt<<endl;

return 0;}

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

int main()
{
    int n,Count=0;
    scanf("%d",&n);
    char s[n];
    scanf("%s",&s);
    for(int i=0; i<n-2; i++){
        if(s[i]=='x' && s[i+1]=='x' && s[i+2]=='x') Count++;
    }
    printf("%d\n",Count);
    return  0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>

using namespace std;
int main()
{
    int n;
    cin >> n;
    string arr;
    cin >> arr;
    int len=arr.length();
    int t=0;
    for(int i=0; i<len; i++)
    {
        int m=1;
        for(int j=i+1; j<len; j++)
            if(arr[i]=='x'&&arr[i]==arr[j])
            {
                m++;
                if(m>=3)
                {
                    t++;
                    break;
                }
            }
            else
                break;
    }
    printf("%d\n", t);
    return 0;
}

#include<conio.h>
#include<locale>
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int count = 0, count1 = 0, label = 0;
	for (int i = 0; i < s.length(); i++)
	{
		while (s[i] == 'x')
		{
			count++;
			i++;
			label = 1;
		}
		if ((count >= 3)&&(label==1))
		{
			count1 += (count - 2);
		}
		label = 0;
		count = 0;
	}
	cout << count1;
	//_getch();
}

#include<bits/stdc++.h>
using namespace std;
string s;
int n,cnt,ans;

int main()
{
//	freopen("cf987b.in","r"stdin);
//	freopen("cf978b.out","w",stdout);

	scanf("%d",&n);
	cin>>s;
	for(int i=0; i<n; i++)
	{
		if(s[i]=='x')
		{
			if(cnt==2)
			ans++;
			else cnt++;
		}
		else cnt = 0;
	}
	printf("%d",ans);
	return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n;
	cin >> n;
	n = 0;
	string S;
	cin >> S;
	for (int i = 0; S[i + 2] != '\0'; i++)
	{
		if (S[i] == 'x' &&S[i + 1] == 'x' &&S[i + 2] == 'x')
			n++;
	}
	cout << n;
	return 0;
}

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

int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;

    int ans=0,p=0;

    for(int i=0;i<n;i++)
    {
        if(s[i]=='x'){
            p++;
        }
        else{
            if(p>2) ans+=p-2;
            p=0;
        }
    }
    if(p>2) ans+=p-2;
    cout<<ans;
    return 0;
}

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

char ch[110];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++) cin>>ch[i];
	int cnt=0;
	for(int i=1;i<=n-2;i++)
	{
		if(ch[i]=='x'&&ch[i+1]=='x'&&ch[i+2]=='x') cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}

#include <bits/stdc++.h>

#define MAX ((int)51)
#define INF ((int)1000000000)
#define MOD ((ll)1000000007)
#define EPS ((double)1e-8)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define mod(x) ((x) % MOD)
#define modS(x) ((((x) % MOD) + MOD) % MOD)
#define DAD(x) ((x) >> 1)
#define LEFT(x) ((x) << 1)
#define RIGHT(x) ((x) << 1 | 1)
#define popcount __builtin_popcount
#define clz __builtin_clz
#define ctz __builtin_ctz
#define gcd __gcd
#define endl '\n'

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    //freopen("01.in", "r", stdin);
    //freopen("01.out", "w", stdout);
    string ss = "jose\
                 ariel\
                 romero,\
                 esto\
                 es\
                 una\
                 prueba";
    int n, ans = 0;
    string s;
    cin >> n >> s;
    for(int i = 2 ; i < n ; i++)
        if(s[ i ] == 'x' && s[ i - 1 ] == 'x' && s[ i - 2 ] == 'x')
            ans++;
    cout << ans << endl;

    int asdf=13;

    return 0;
}

#include <iostream>
#include <string>

using namespace std;

string v;

int main() {
    int n, cnt = 0;
    cin >> n >> v;
    int i = 0;
    while ( i < n ) {
        int j = i, cj;
        bool ok = false;
        while ( j < n && v[j] == 'x' )
            j ++;
        if ( j - i - 2 < 0 ) {
            cj = j;
            j = i + 2;
            ok = true;
        }
        cnt += j - i - 2;
        if ( ok )
            j = cj;
        i = j + 1;
    }
    cout << cnt << "\n";
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int a,c=0;
    cin>>a;
    string b;
    cin>>b;
    for(int u=0 ; u<=(a-3);u++)
    {if(b[u]=='x' && b[u+1]=='x' && b[u+2]=='x')
    {c++;}}
    cout<<c;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n ;
	cin >> n;
	string s;
	cin >> s;
	int ans = 0;
	int ct = 0;
	long int i;
	for( i = 0;i < n; i++){
		if(s[i] == 'x')
		   ct++;
		else
		{
		 ans += max(0, ct - 2);
		 ct = 0;
		}
	}
	ans += max(0, ct - 2);
	cout << ans;

}

#include<bits/stdc++.h>
using namespace std;
int n,s;
char a[105];
void sc (int x){
	for (int i=x;i<=n;i++) a[i]=a[i+1];
	n--;
}
int main (){
    scanf ("%d",&n);
    scanf ("%s",a+1);
    for (int i=1;i<=n;i++){
    	if (a[i]=='x'&&a[i+1]=='x'&&a[i+2]=='x') sc(i),i--,s++;
    }
    printf ("%d",s);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int cnt = 0;
	int tot = 0;
	for(int i = 0; i < n; i++)
	{
		if(s[i] == 'x'){
			cnt++;
		}else{
			if(cnt > 2){
				tot += (cnt - 2);
			}
			cnt = 0;
		}
	}
	if(cnt == n){
		cout << cnt - 2  << "\n";
	}else if(cnt > 2){
		cout << tot + (cnt-2) << endl;
	}else {
		cout << tot << endl;
	}
	return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    std::string s;
    cin>>s;
     int nox=0,cnt=0;
     for(int i=0;i<n;i++)
     { if(s[i]=='x')
        {cnt++;
        if(cnt>2)
            {nox++;

            }
        }
        else
            cnt=0;
     }
 cout<<nox<<endl;

}

#include<stdio.h>
#include<string.h>
#include<math.h>
/* *********************************************************** */

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

//************************************************************ */

#define fin             freopen("in.txt","r",stdin)
#define fou             freopen("ou.txt","w",stdout)
#define ll              long long
#define ull             unsigned long long
#define sc              scanf
#define pr              printf
#define FastIO	        ios_base::sync_with_stdio(false); cin.tie(NULL)
#define mset(v,d)       memset(v, d, sizeof(v))
#define sc1(a)          sc("%d",&a)
#define sc2(a,n)        sc("%d%d",&a,&n)
#define sc3(a,n,m)      sc("%d%d%d",&a,&n,&m)
#define pr1(a)          pr("%d\n",a)
#define so(a,n)         sort(a,a+n)
#define br              puts("")
#define pb(a)           push_back(a)
#define pbk(a)          pop_back()
#define ln              length()
#define sz              size()
#define pr2(a,n)        pr("%d %d\n",a,n)
#define rn              return
#define For(i,lo,n) 	for(int i = lo; i < n; i++)
#define Forr(i,lo,n) 	for(int i = n; i >= lo; i--)
#define Frl(i,n) 	    for(int i = 0; i < n; i++)
#define acin(a,n)  	    for(int i = 0; i < n; i++)  cin>>a[i]
#define ain(a,n)  	    for(int i = 0; i < n; i++)  scanf("%d",&a[i])
#define aou(a,n)        for(int i = 0; i < n; i++)  pr("%d ",a[i])

typedef vector<int> vi;
typedef vector <ll> vll;
typedef map<string, int> msi;

//*************************************************************/

int n,m,i,j,o=0;

void fm(){
    #ifndef ONLINE_JUDGE
        fin;
       // fou;
    #endif
}

//map<string, int>v;
//vector<int> vv;
//int a[4];
typedef struct pai{
    int x,y;

}pa;
//typedef pai pa
int a[100001],b[100],d[100];
int main()
{
    FastIO;
    cin>>n;
    string a;
    cin>>a;
    //cout<<a;
    int cc=0,c=0;
    for(i=0;i<n-2;i++)
    {
        if(a[i]=='x')
        {
            if(a[i]==a[i+1]&&i+2<n)
            {
                cc=2;
                for(j=i+2;j<n;j++)
                {
                    if(a[j]!='x')break;
                    cc++;

                }
                //pr1(cc);
                if(cc>2)c+=(cc-2);
                i=j-1;
            }
        }
    }
    //printf("%d\n",c);
    cout<<c<<endl;
    rn 0;

}

#include<iostream>
#include<algorithm>
#include<string>
#include<stdio.h>
#include<string.h>
using namespace std;
int main() {
	int n;char a[120];
	cin >> n; int ans = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	for (int i = 0; i < n-2; i++)
	{
		if (a[i] == 'x'&&a[i + 1] == 'x'&&a[i + 2] == 'x')
			ans++;
	}
	cout << ans << endl;
}

#include <iostream>
using namespace std;
int n, c, s;
string a;
int main() {
	cin>>n>>a;
	for(int i=0; i<n; i++)
	a[i]=='x' ? s += (++c>2) : c = 0;
	cout<<s;
}

#include<bits/stdc++.h>
using namespace std;
int a,c,d,e;
char b[101];
int main()
{
	cin>>a>>b;
	for(;c<a;c++)
	{
		d=(b[c]==120)?d+1:0;
		if(d>2)
		{
			e++;
		}
	}
	cout<<e;
	return 0;
}

#include <iostream>
#include <string>
using namespace std;
void main()
{
	int n, p = 0;
	char a[100];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		if (a[i] == 'x')
		{
			p++;
		}
	}
	int k = 0;
	if (p < 2)
	{
		cout << 0;
	}
	else
	{
		for (int i = 0; i < n - 2; i++)
		{
			if (a[i] == 'x' && a[i + 1] == 'x' && a[i + 2] == 'x')
			{
				k++;
			}
		}
		cout << k;
	}
	;
}

/* Coder: @SumitRaut
 * Date: 05-09-2020 10:38:26
 */
#include <bits/stdc++.h>
#define debug1(x) cout<<#x<<' '<<x<<'\n'
#define debug2(x,y) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<'\n'
#define debug3(x,y,z) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<'\n'
#define ll long long
#define speedup ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr)
using namespace std;

void solve() {
    int n;
    cin>>n;
    string str;
    cin>>str;
    int ans=0,c=0;
    for(auto &it:str) {
        if(it=='x') ++c;
        else ans+=max(0,c-2),c=0;
    }
    ans+=max(0,c-2);
    cout<<ans<<'\n';
}
int main()
{
    speedup;
    // int t; cin>>t; while(t--)
    solve();
    return 0;
}

#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int main() {
	bool b;
	int n, counter = 0, ANS = 0;
	string s;
	cin >> n >> s;
	for (int i = 0; i < s.length(); ++i) {
		if (s[i] != 'x')
			b = 0;
		else
			b = 1;
		if (b)
			counter++;
		else {
			if (counter >= 3)
				ANS += counter - 2;
			counter = 0;
		}
		if (i == s.length() - 1 && counter > 0 && counter >= 3)
			ANS += counter - 2;
	}
	cout << ANS;
	return 0;
}

#include <iostream>
using namespace std;

int main()
{
    int n,c=0,ans=0,j;cin>>n;
    char a[n+1];cin>>a;
    for(int i=0;i<n;i=i+c)
    {
        c=0;
        if(a[i]=='x')
        {
            j=i;
            while(a[j]=='x' && j<n)
            {
                c++;j++;
            }
            if(c>=3)ans=ans+(c-2);
        }
        if(c==0)c=1;
    }
    cout<<ans;
}

#include<stdio.h>
using namespace std;
int main()
{
    char str[1005];
    int n;
    scanf("%d",&n);
    scanf("%s",str);
    int ans=0;
    for(int i=0;i+2<n;i++)
    {
        if(str[i]=='x'&&str[i+1]=='x'&&str[i+2]=='x')
            ans++;
    }
    printf("%d\n",ans);
    return 0;
}
//2019-07-21 19:08:07.387

#include<stdio.h>
#include<string.h>
int main(){

 int i,j,count=0,n,count1=0;
 char str[1000];
 scanf("%d",&n);
 scanf("%s",str);

 for(i=0;i<n;i++){// printf("count = %d\n",count);
    //if(str[i]=='x'){
      //  count++;
    //}
    if(str[i-1]=='x' && str[i]=='x' && str[i+1]=='x'){
        count1++;
    }
 }
 //printf("%d\n",count);
 //printf("%d\n",count1);

 //count=count-count1;

 printf("%d\n",count1);

 return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int d=0;
    while(s.find("xxx",0)!=-1)
    {
        s.erase(s.find("xxx",0),1);
        d++;
    }
    cout<<d;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
string n;
long long ans,a;
int main()
{
    cin>>a>>n;
    while(n.find("xxx")!=-1)
    {
        n.erase(n.find("xxx"),1);
        ans++;
    }
    cout<<ans;
}

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define debug(n) cout << "DEBUG1 " << n << "\n";
#define debug2(n, m) cout << "DEBUG2 " << n << ' ' << m << "\n";
#define debug3(n, m, x) cout << "DEBUG3 " << n << ' ' << m << ' ' << x << "\n";
#pragma GCC optimize("O3")
using namespace std;
long long int mod(long long int b, long long int p, long long int m) {
    if (p == 0) return 1;
    else if (p % 2 == 0) return (mod(b, p / 2, m) * mod(b, p / 2, m)) % m; // a^(p/2) * a^(p/2) = a^p
    else if (p % 2 == 1) return (mod(b, (p - 1) / 2, m) * mod(b, (p - 1) / 2, m) * b) % m;
    else return 0; // a function must return something
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin >> n;
    char c;
    int cnt = 0;
    int sum = 0;
    for (int i = 0;i < n;i++) {
    	cin >> c;
    	if (c == 'x') {
    		cnt++;
		} else {
			if (cnt >= 3) sum += cnt - 2;
			cnt = 0;
		}
	}
	if (cnt >= 3) sum += cnt - 2;
	cout << sum << endl;
}

#include<bits/stdc++.h>
#define ll long long int
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl

using namespace std;

int main()
{
    int n,l,cnt=0,c=0;
    string s;
    cin>>n>>s;
    l=s.size();

    for(int i=0; i<l-2; i++)
    {
        if(s[i]=='x' && s[i+1]=='x' && s[i+2]=='x')
        {
            c++;
        }
    }
    cout<<c<<endl;

}

#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <bits/stdc++.h>
#define lli long long int
#define li long int
#define ld long double
using namespace std;

int main() {
    int n,cnt=0;
    string s;
    cin>>n>>s;
    for(int i=0;i<=n-3;i++){
        if(s.substr(i,3)=="xxx") cnt++;
    }
    cout<<cnt<<endl;

}

#include<iostream>
#include<string.h>
#include<string>
using namespace std;
int main(){
	int n,i,x=0,j,y;
	cin>>n;
	char a[101];
	for(i=0;i<n;++i){
		cin>>a[i];
	}
	i=0;
	while(i<n){

		if(a[i]=='x'){
			y=1;
			for(j=i+1;j<n;++j){
				if(a[j]=='x'){
					++y;
					i=j;
				}
				if(a[j]!='x') break;
			}
			if(y>=3) x=x+y-2;
		}
		++i;
	}
	cout<<x;
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
	int out = 0;
	int n;
	int count = 0;
	char *arr;

	scanf("%d", &n);
	arr = (char*)malloc(sizeof(char)*(n + 1));
	scanf("%s", arr);

	for (int i = 0;i < n - 2;) {
		count = 0;
		if (arr[i] == 'x' && arr[i + 1] == 'x' && arr[i + 2] == 'x') {
			for (int j = i + 2;j < n;j++) {
				if (arr[j] == 'x') {
					count++;
					out++;
				}
				else break;
			}
		}
		if (count != 0) i = i + count + 2;
		else i++;
	}

	printf("%d", out);
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,p=0,q=0;
    cin>>a;
    char s;
    for(int i=0;i<a;i++)
    {
        cin>>s;
        if(s=='x')
        {
            p++;
             if(p>2)
        {
            q++;
        }
        }

        else
        {
            p=0;
        }
    }
   cout<<q<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int cnt = 0;
	int tot = 0;
	for(int i = 0; i < n; i++)
	{
		if(s[i] == 'x'){
			cnt++;
		}else{
			if(cnt > 2){
				tot += (cnt - 2);
			}
			cnt = 0;
		}
	}
	if(cnt == n){
		cout << cnt - 2  << "\n";
	}else if(cnt > 2){
		cout << tot + (cnt-2) << endl;
	}else {
		cout << tot << endl;
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n ; cin >> n;
	string s ; cin >> s;

	int total = 0 , NumberOfX = 0 ;

	char PrevChar = ' ';
	for (int i = 0 ; i < n ; i++)
    {
        if (s[i] == 'x')
        {
            if (NumberOfX >= 2)
                ++total;
            else
                ++NumberOfX;
        }else
            NumberOfX = 0;
    }

    cout << total ;

    return 0;
}

#include <iostream>

using namespace std;

int main() {

  int n,cnt,tmp;
  tmp=2;
  cin>>n;
  cnt=0;
  string s;
  cin>>s;
  bool flag=0;
  for(int i=0;i<n;i++)
  {
    if(s[i]!='x') {tmp=2;}
    else
    {
      if(tmp>0) {cnt--; tmp--;}
      cnt++;
    }

  }

  cout<<cnt;

  return 0;
}

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

int main(){
    int n, ans=0, a=0;
    string s;
    cin >> n >> s;
    for(int i=0;i<n;i++){
        if(s[i]=='x')
        {
            a++;
            if(a>2)
                ans++;
        }
        else a=0;
    }
    cout << ans << endl;
return 0;
}

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
int sum,len,ans;
char ch,s[105];
int main()
{
    cin>>len>>s;
    ch=s[0];
    for (int i=0;i<len;i++)
        if (ch==s[i]&&ch=='x')
        {
            sum++;
            if (sum>=3)
                ans++;
        }
        else
        {
            ch=s[i];
            sum=1;
        }
    cout<<ans;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;
const int maxn=2e5;
char s[maxn];
int a[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    scanf("%s",s+1);
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
        int flag=0;
        int temp=0;
        while(s[i]=='x')
        {
            flag=1;
            temp++;
            i++;
        }
        if(flag)
        {
            if(temp>=3)
            {
                a[++cnt]=temp;
            }
            i--;
        }
    }
    int ans=0;
    for(int i=1;i<=cnt;i++)
    {
        ans+=a[i]-2;
    }
    printf("%d\n",ans);
}

#include<iostream>
using namespace std;
int main()
{
    int n,i=0,j=0,v=0,c=0;
    cin>>n;
    char s[200];
    for(i=0;i<n;i++)
     cin>>s[i];
    for(i=0;i<n;i++)
    {
        if(s[i]=='x')
            c=c+1;
        else
            {if(c>2)
              v=v+c-2;
              c=0;

            }
    }
    if(c>2)
    v=v+c-2;
    cout<<v;
}

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	int s=0, n, i;
	string str;
	cin >> n;
	cin >> str;
	for (i = 1;i < n - 1;i++)
	{
		if (str[i - 1] == 'x'&&str[i] == 'x'&&str[i + 1] == 'x')
			s++;
	}
	cout << s;
	getchar();
	getchar();
	return 0;
}

#include <iostream>
#include <vector>
#include <cstdio>
#include <string>

#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n

using namespace std;

using std::cout;
using std::cin;
using std::vector;
using std::pair;
using std::string;
using std::ios_base;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

int32_t main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int N;
	cin >> N;

	string message;
	cin >> message;

	int num_removals = 0;

	int num_x = 0;

	for (int i = 0; i < N; i++)
	{
		if (message[i] != 'x')
			num_x = 0;
		else
		{
			if (num_x <= 2)
				num_x++;
			if (num_x >= 3)
				num_removals++;
		}
	}
//	bool other_found = false;
	//for (int i = 0; i < N; i++)
	//{
	//	if (message[i] != 'x')
	//	{
//	//		other_found = true;

	//		if (num_x >= 3)
	//			num_removals += num_x - 2;
	//		num_x = 0;
	//	}
	//	else
	//		num_x++;
	//}

	//if (num_x >= 3)
	//	num_removals += num_x - 2;
//	if (!other_found)
//		num_removals += num_x - 2;
	cout << num_removals << "\n";
	return 0;
}

#include <iostream>
#include <cstring>
#include <cmath>

#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>

#include <algorithm>
#include <functional>

#define N 300000 + 5 /* 3e5 +  5 */

#define pii pair<int, int>

#define piii pair<int, pair<int, int> >

using namespace std;

typedef long long ll;

int dx[] = { 0, 0, -1, 1 };
int dy[] = { -1, 1, 0, 0 };

// ll n, k, ary[N], sum[N];

int n;

string s;

int main(void)
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);

	cin >> n >> s;

	int len = 1;

	vector<int> v;

	for (int i = 0; i < n; ++i) {
		while (i < n && s[i] == 'x' && s[i + 1] == 'x') {
			++len;
			++i;
		}
		v.emplace_back(len);
		len = 1;
	}

	int ans = 0;

	for (auto x : v) {
		if (x >= 3) {
			ans += (x - 2);
		}
	}

	cout << ans;

	return 0;
}

#include<iostream>
using namespace std;

int main(){
int n, count = 0;
const int SIZE = 100;
char name[SIZE];
cin>>n;

for(int i = 0; i < n; i++)
{
	cin>>name[i];
}

for(int i = 0; i < n; i++)
{
	if(name[i] == 'x' && name[i+1] == 'x' && name[i+2] == 'x') count++;
}

cout<<count<<endl;
return 0;
}

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
	int length = 0;
	cin >> length;
	string input;
	cin >> input;
	int count = 0;
	int sumX = 0;
	for (int i = 0; i < length; i++)
	{
		if (input[i] == 'x')count++;
		if (input[i] != 'x')count = 0;
		if (count > 2)sumX++;
	}
	cout << sumX;
}

#include <iostream>
using namespace std ;
int main(){
	int n,count=0;
	cin>>n;
	char *a;
	a=new char[n];
	for(int i=0 ; i<n ; i++){
		cin>>a[i];
	}
	for(int i=0 ; i<n ; i++){
		if(a[i]=='x' && a[i+1]=='x' && a[i+2]=='x'){
			count++;
		}
	}
	cout<<count;
}

#include <iostream>

using namespace std;

int main(){
    short n, r, s = 0; string st;
    cin >> n >> st;
    if (st[0] == 'x') r = 1; else r = 0;
    for (int i = 1; i < n; i++){
        if (st[i] == 'x') r++; else{
            if (r > 2) s += r - 2;
            //cout << s << r << endl;
            r = 0;
        }
    }
    if (r > 2) s += r - 2;
    cout << s;
    return 0;
}

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

int main(){

    int n;
    cin>>n;
    string s="";
    string x;

   for(int i=0;i<n;i++){
      cin>>x;
      s=s+x;
   }

    int c=0;

    if(n<=2){
        cout<<0;
    }
    else{
        for(int i=2;i<n;i++){
            if(s[i]=='x'){
                if(s[i-1]=='x')
                if(s[i-2]=='x')
                    c++;
        }
    }

    cout<<c;
    }
    return 0;
}

//FIle name

#include<iostream>
#include<string>
using namespace std;

int main(){

	char s[100];

	int n;
	int cnt=0;

	cin>>n;
	cin>>s;

	for(int i=0;i<n-2;i++){

		if(s[i]=='x' && s[i+1]=='x' && s[i+2]=='x' )
		cnt++;

	}

	cout<<cnt<<endl;

}

#include<bits/stdc++.h>
using namespace std;
char s[105];
int main(){
    int n;
    scanf("%d",&n);
    scanf("%s",s);
    int len=strlen(s);
    int sum=0;
    for(int i=0;i<=len-3;i++){
        int j;
        for(j=i;j<i+3;j++){
            if(s[j]!='x'){
                break;
            }
        }
        if(j==i+3) sum++;
    }
    printf("%d\n",sum);
}

#include<iostream>
using namespace std;
int main () {
    int t=0,n;
    string s;
    cin>>n>>s;
    for(int i=2;i<s.size();i++){
            if(s[i]=='x' && s[i-1]=='x' && s[i-2]=='x')t++;
    }
    cout<<t;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
//Int data type
#define sc1(a)              scanf("%d", &a)
#define sc2(a, b)           scanf("%d %d", &a, &b)
#define sc3(a, b, c)        scanf("%d %d %d", &a, &b, &c)
#define sc4(a, b, c, d)     scanf("%d %d %d %d", &a, &b, &c, &d)

int main()
{
    int n,m,i,j,a,b,ck=0;
    sc1(n);
    string arr;
    cin>>arr;
    for(i=0; i<n; i++){
        if(arr.compare(i, 3, "xxx")==0)
            ck++;
    }
    cout<<ck<<endl;
}

#include<bits/stdc++.h>
#define Ishaan using
#define M namespace
#define Tandel std
#define tt long long int t;cin>>t;while(t--)
#define fir(i, j, k) for (int i=j; i<k; i++)
#define fr(i,j,k) for (int i=j ; i<=k ; i++)
#define rev(i, j, k) for(int i=j; i>=k; i--)
#define REP(i, k) for(int i = (0); i < (k); i++ )
#define RREP(i, k) for(int i = j; i >= (k); i-- )
#define FOREACH(it, l) for(auto it=l.begin(); it != l.end(); it++)
#define mp make_pair
#define pb push_back
#define RESET(a, b) memset(a, b, sizeof(a))
#define INF (2e+18)
#define EPS (int)1e-9
#define PI acos(-1)
#define MOD 1000000007

Ishaan M Tandel;

typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<piii> viii;
typedef long long int ll;
typedef unsigned long long int ull;
typedef string s;
typedef float ff;
typedef double dd;

void imt()
{
        ll n;
        cin>>n;

        s a;

        cin>>a;
        ll ans=0;
        ll c=0;

        ll sum=0;

        fir(i,0,n)
        {
            if(a[i]=='x')
            {
                c++;
            }
            else
            {
                if(c>=3)
                {
                    ans += c-2;
                }
                c=0;
            }

        }

        if(c>=3)
        {
            ans += c-2;
        }

        cout<<ans<<endl;
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen ("input.txt","r",stdin);
        freopen ("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int TC = 1;
    //cin >> TC;

    REP(tc, TC)
    {
        imt();

    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int d=0;
    while(s.find("xxx",0)!=-1)
    {
        s.erase(s.find("xxx",0),1);
        d++;
    }
    cout<<d;
    return 0;
}

#include<iostream>

using namespace std;

int main(){
    int n;
    string s;
    cin >> n >> s;
    int len = 0;
    int count = 0;
    for (int i = 0; i < n-2; i++){
        if (s[i] =='x' && s[i+1]=='x' && s[i+2]=='x'){
            count++;
        }
    }
    cout << count << endl;

    return 0;
}

#include<cstdio>
char tmp[100];
int main()
{
	int n;
	int ans=0;
	scanf("%d",&n);
	scanf("%s",tmp);
	for(int i=2;i<n;i++)
	{
		if(tmp[i]=='x'&&tmp[i-1]=='x'&&tmp[i-2]=='x')
		{
			ans++;
		}
	}
	printf("%d\n",ans);
	return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main()
{

	int n;
	cin >> n;
	string str;
	cin >> str;

	int flag = 0, count = 0;
	for (int i = 0; i < n; i++) {
		if (str[i] == 'x') flag++;
		else flag = 0;
		if (flag == 3) {
			flag--;
			count++;
		}
	}
	cout << count << endl;
	return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main() {
	int n,i=0,p=0,m=0;
	string s;
	cin>>n>>s;
	while (n--) {
	    if (s[i]=='x') {m++; i++;}
	    else if (m>2) {p+=m-2; m=0; i++;}
	        else {m=0; i++;}
	    if (!n && m>2) p+=m-2;

	}

	cout<<p;
}

#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
using namespace std;

int main()
{
    int len;
    string file_name;

    cin>>len;
    cin>>file_name;

    int to_delete = 0;
    int consecutive_x = 0;

    for (int idx = 0; idx < len; idx++)
    {
        if (file_name[idx] == 'x')
        {
            if (consecutive_x == 2)
            {
                ++to_delete;
            }
            else
            {
                ++consecutive_x;
            }
        }
        else
        {
            consecutive_x = 0;
        }
    }

    cout<<to_delete;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,ans=0,a=0;
    string s;
    cin>>n>>s;
    for(int i=0; i<n; i++)
    {
        if(s[i]=='x')
        {
            a++;
            if(a>2)
                ans++;
        }
        else
            a=0;
    }
    cout<<ans<<endl;
    return 0;
}

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

int main() {
	// your code goes here
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,c=0,cm=0;
	cin>>n;
	string s;
	cin>>s;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='x')
		c++;
;
		if(s[i]!='x')
		c=0;
		if(c>=3)
		{
			cm=cm+1;

		}
		cout<<i<<'n'<<c<<'n'<<cm<<'n';
	}
	cout<<cm;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
	int n, i, j, x, r;
	char c;
	scanf("%d", &n);
	x = r = 0;
	for(i = 0; i < n; i ++){
		scanf(" %c", &c);
		if(c == 'x')
			x ++;
		else if(x >= 3){
			r += x - 2;
			x = 0;
		}
	}
	if(x >= 3)
		r += x - 2;
	printf("%d\n", r);
	return(0);
}

#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <unordered_set>
#define elif else if
typedef short int si;
typedef unsigned short int usi;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;
int main() {
    ll n;
    cin>>n;
    ll ans = 0, now = 0;
    for (ll i=0; i<n; ++i){
        char temp;
        cin>>temp;
        if (temp=='x')
            ++now;
        else{
            ans+=max(ll(0),now-2);
            now=0;
        }
    }
    cout<<ans;
    return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <iterator>

using namespace std;

int a, b, c, d, n, x, mas[100000];
string s, s1, s2, sas[100000];

int main()
{
	ios::sync_with_stdio(0);
	cin >> a;
	cin >> s;
	for (int i = 0; i < a; i++)
	{
		for (int k = 0; k < a; k++)
		{
			n = 0;
			if (s[k] == 'x')
				c++;
			if (s[k] != 'x')
				c = 0;
			if (c == 3)
			{
				n = 1;
				d = k;
				break;
			}
		}
		if (n == 1)
		{
			a--;
			s.erase(d, 1);
			x++;
		}
	}
	cout << x;
}

#include <iostream>
#include <string>
using namespace std;

int main()
{
    int x;
    cin>>x;
    string num;
    cin>>num;
    int c=0;
    for(int i=0;i<x;i++){
        if(i<x-4){
            if(num.substr(i,3)=="xxx"){
                c++;
            }
        }
    }
    cout<<c;
    return 0;
}

#include <iostream>
using namespace std;
int main() {
	int n, c, total=0;//total必须要初赋值，不然543836282
	string a;
	cin>>n>>a;
	for(int i=0;i<n;i++)
		a[i]=='x' ? total += (++c>2) : c = 0;
	//if(s[i]=='x' and s[i+1]=='x' and s[i+2]=='x') k++;
	//相当于不断判断是不是够三个
	cout<<total<<endl;
}

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

int main(){

    int n,i, xc=0, xr=0; cin>>n;
    string x; cin>>x;

    for(i=0; i<n; i++){
        if(x[i]=='x'){
            xc++;
            if(xc==n)
                xr=xc-2;
        }else if(xc>=2 && xc!=n){
            xr=xc-2;
            xc=0;
        }
    }
    cout<<xr<<endl;
}

#include<stdio.h>
#include<string.h>
int main(){

 int i,j,count=0,n;
 char str[1000];
 scanf("%d",&n);
 scanf("%s",str);
 //printf("%s",str);

 //for(i=0;i<n;i++){// printf("count = %d\n",count);
   //     scanf("%c",str);
    //}

    //for(i=0;i<n;i++){// printf("count = %d\n",count);
    //printf("%c",str);
    //}

 for(i=0;i<n;i++){// printf("count = %d\n",count);
    if(str[i]=='x'){
        count++;
        //printf("count = %d\n",count);
    }
    if(str[i-1]=='x' && str[i]!='x' && count==2)
        count=0;
 }
 if(count==0)printf("0\n");
 else
 {
     count=count-2;
    printf("%d\n",count);
 }
return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define inf INT_MAX
#define mk make_pair
#define MOD 1000000007
#define in insert
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    ll n;	cin>>n;
    string s;	cin>>s;
    ll cx=1,ans=0,f=0;
    for(ll i=0;i<n-1;i++)
    {
    	if(s[i]=='x' && s[i+1]=='x')
    	{
    		cx++;
		}
		else
		{
			f=1;
			if(cx>=3)
				ans+=cx-2;
			cx=1;
		}
	}
	if(cx>=3)
		ans+=cx-2;
	if(ans==0 && f==0)
	{
		cout<<cx-2<<endl;
	}
	else if(f==1)
	{
		cout<<ans<<endl;
	}
	else
		cout<<0<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	string s;
	cin>>n>>s;
	int ans=0;
	for(int i=0;i<n-3;i++)
	{
		if(i+3<n && s[i]=='x' && s[i+1]=='x' && s[i+2]=='x')
		{
			ans+=1;
			i=i+3;
			int count=0;
			while(s[i]=='x')
			{
				i++;
				count++;
			}
			ans+=count;
			i--;
		}
	}
	cout<<ans<<endl;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
	int n, i, j, x, r;
	char c;
	scanf("%d", &n);
	x = r = 0;
	for(i = 0; i < n; i ++){
		cin >> c;
		if(c == 'x')
			x ++;
		else if(x >= 3){
			r += x - 2;
			x = 0;
		}
	}
	if(x >= 3)
		r += x - 2;
	printf("%d\n", r);
	return(0);
}

#include<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<utility>
#include<functional>
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	int n, res = 0;
	string s;
	cin >> n;
	cin >> s;
	int len = s.size(), ok = 0, cur ;
	for (int i = 2; i < len; i++)
	{
		if (s[i] == 'x' && s[i - 1] == 'x' && s[i - 2] == 'x')
		{
			ok = 1;
			cur = 1;
			continue;
		}
		if (s[i] == 'x' && ok)
			cur++;
		else if (s[i] != 'x'&& ok)
		{
			res += cur;
			ok = 0;
		}
	}
	cout << res << endl;
	return 0;
}

#include <iostream>
#include <cstdio>
#include <windows.h>
#include <cstring>

using namespace std;

typedef long long ll;
const int INF = 100005;
int n;
char a[105];
int t1 = 0,t2 = 0;
int main()
{
    cin >> n;
    for(int i = 0;i < n;i++)
    {
        cin >> a[i];
    }
    int t1 = 0,t2 = 0;
    if(a[0]=='x'&&a[1] == 'x'&&a[2] == 'x')
    {
        for(int i = 2;i < n;i++)
        {
            if(a[i] == 'x')
                t1++;
            else
                break;
        }
        for(int i = 2;i < n - 2;i++)
        {
            if(a[i - 1]!='x')
            {
                if(a[i] == 'x' && a[i+1] == 'x'&&a[i+2]=='x')
                {
                    for(int j = i+2;j < n;j++)
                    {
                        if(a[j] == 'x')
                            t1++;
                        else
                            break;
                    }
                    /*for(int j = i+2;j < n-2;j++)
                    {
                        if(a[j - 1]!='x')
                        {
                            if(a[j] == 'x' && a[j+1] == 'x'&& a[j+2] == 'x')
                                t2++;
                        }
                    }*/
                }
            }
        }
    }
    else
    {
        cout <<"0"<<endl;
        return 0;
    }
    cout << t1+t2 << endl;
    return 0;
}

#include<iostream>
#include<deque>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<cmath>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<numeric>
#include<iomanip>
#include <ostream>
using namespace std;
#ifdef LOCAL
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
#define f(i,l,n) for(int i = l;i < n;i++)
#define f0(i,n) f(i,0,n)
#define pb push_back
#define pob pop_back
#define ci cin >>
#define co cout <<
int main(){
    int n = 0;
    int k;
    ci k;
    string s;
    ci s;

    for(int i = 0;i < k;i++){
        if(s[i] == 'x'){
            int b = 0;
            int l;
            for(int j = i;j < k;j++){
                if(s[j] == 'x'){
                    b++;
                    l = j;
                }
                else{
                    break;
                }
            }
            if(b >= 3){
                n = b - 2;
            }
            i = l;
        }

    }
    co n;
}

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
//#include<utility>
using namespace std;
int main(){
        int n;
       cin>>n;
       string s;
       int c=1;
       cin>>s;
       for(int i=0;i<n-1;i++){
                 if(s[i]==s[i+1] && s[i]=='x')
                 c++;
                if(c>=3)
                break;
       }
          if(c>=3)
          cout<<c-2;
          else
          cout<<c;

          return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main () {

    ios_base :: sync_with_stdio (0);
    cin.tie (0); cout.tie (0);
//    freopen("input.txt" , "r" , stdin);
//    freopen("output.txt" , "w" , stdout);
    int n ;
    cin >> n;
    string s;
    cin >> s;
    int kol = 0 , ans = 0;
    for(int i = 0 ; i < n ; i++){
        if(s[i] == 'x' and i != n - 1)kol++;
        else{
            if(s[i] != 'x'){
                if(kol >= 3)ans += kol - 2 , kol = 0;
            }else
                if(kol >= 2)ans += kol - 1 , kol = 0;
        }

    }
    cout << ans << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
string st;
int x,ans;
int main()
{
	cin>>x;
	x=0;
    cin>>st;
    for(int i=0;i<st.size();i++)
    {
    	if(st[i]=='x')x++;
    	  else ans+=x>2?x-2:0,x=0;
	}
	cout<<ans;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
        int n, x = 0, cnt = 0, y;
        string s;
        cin >> n >> s;

        for (int i = 0; i < n; i++)
        {
                if (s[i] == 'x')
                {
                        for (int j = i; j < n; j++)
                        {
                                if (s[i] == s[j])
                                {
                                        cnt++;
                                        if (j == n-1)
                                        {
                                                y = 1;
                                                break;
                                        }
                                }

                                else
                                {
                                        i = j;
                                        break;
                                }
                        }

                        if (cnt >= 3)
                                x += cnt - 2;
                        cnt = 0;
                }

                if (y == 1)
                        break;
        }

        cout << x;
}

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstring>
#include<numeric>
#include<climits>
#include<string>
#include<map>
#include<unordered_map>
#include<stack>
#include<set>
#include<unordered_set>

const long long MAX = 1000001;
const int mod = 1e9+7;
const double pi1 = acos(-1.0);
#define pi2 3.14159265358979323846264338327950
#define ll long long
#define pb push_back
#define f first
#define s second
#define all(x) (x).begin(), (x).end()
#define ub(x,k) ((upper_bound(all(x),k)) - ((x).begin()))
#define lb(x,k) ((lower_bound(all(x),k)) - ((x).begin()))
#define pii pair<int, int>

using namespace std;

ll binpow(ll a, ll n){
    ll res = 1;
    while(n>0){
        if(n&1){
            res *= a;
        }
        a*=a;
        n >>=1;
    }
    return res;
}

int n, total = 0;
string str;

int main(void){
    scanf("%d",&n);
    cin >> str;
    int cnt = 0;
    for(int i = 0;i < str.length(); i++){
        if(str[i] == 'x'){
            cnt++;
            continue;
        }
        if(cnt >= 3){
            // cout << cnt<<" ";
            total += cnt - 2;
        }
            cnt = 0;
    }
    // cout << cnt << "cnt\n";
    if(cnt > 0) total += cnt - 2;
    printf("%d\n", total);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,dus=0,ob=0;
	cin >> n;
	char c;
	for(int i=0; i<n;i++){
		cin>>c;
		if(c=='x')dus++;
		else{
			if(dus>2)ob+=dus-2;
			dus=0;
		}
	}
	ob+=dus-2;
	cout<<ob;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,c=0;
cin>>n;
string s;
for(int i=0;i<n-2;i++)
{
if(s[i]=='x'&&s[i+1]=='x'&&s[i+2]=='x')
c=c+1;}
cout<<c;
return 0;}

#include<cstdio>
using namespace std;
#define R register
int n;
char a[110];
inline void read(R int &x)
{
	x = 0;R char ch = getchar();R bool f = false;
	for(;ch < 48 || ch > 57;ch = getchar())f |= (ch == '-');
	for(;ch > 47 && ch < 58;ch = getchar())x = (x << 3) + (x << 1) + (ch ^ 48);
	(f) && (x = -x);
}
int main()
{
	read(n);
	scanf("%s",a);
	R int cnt = 0;
	for(R int i = n - 1;i >= 2; --i)
	{
		putchar(a[i]);printf("%d ",i);
		if(a[i] == 'x' && a[i] == a[i - 1] && a[i] == a[i - 2])
		{
			cnt++;
			continue;
		}
	}
	printf("%d",cnt);
}

# include <bits/stdc++.h>

using namespace std;

# define rep(i,n) for(int i=0;i<n;i++)

int main()
{
	int n;
	cin >> n;

	string s;
	cin >> s;

	int flag = 0;
	int count = 0;

	rep(i,s.size())
	{
		if(s[i] == 'x')
		{
		//	cout << "yeah";
			flag++;

		}
		else
		{
			if(flag >= 3)
			{
				count = count + (flag - 2);
			}
			flag = 0;
		}
		// cout << flag << endl;
		// cout << count << endl;
	}
	if(flag > 0)
		{count = count + (flag - 2);}
	cout << count << endl;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int MAXN = 110;

int main(){
  ios_base:: sync_with_stdio(false); cin.tie(0);
  char msg[MAXN];
  int n;
  cin >> n;

  for(int i = 0; i < n; i++)
    cin >> msg[i];

  vector <int> resp;
  char last;
  int num_x = 0;
  for(int i = 0; i < n; i++){
    if (msg[i] == 'x')
    {
      num_x++;
    }
    else if (num_x >= 3)
    {
      resp.push_back(num_x);
      num_x = 0;
    }
    else
    {
      num_x = 0;
    }
    last = msg[i];
  }

  if (num_x > 0 && last == 'x')
    resp.push_back(num_x);

  int tot = 0;
  for(int i = 0; i < (int) resp.size(); i++)
    tot += resp[i] - 2;

  cout << tot << endl;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int cnt = 0;
	int tot = 0;
	for(int i = 0; i < n; i++)
	{
		if(s[i] == 'x'){
			cnt++;
		}else{
			if(cnt > 2){
				tot += (cnt - 2);
			}
			cnt = 0;
		}
	}
	if(cnt == n) cout << cnt - 2  << "\n";
	else cout << tot << endl;
	return 0;
}

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

int main(){

      int n,i,count=0;
      cin >> n;
      string s;
      for (i=0;i<n;i++){
         cin >> s[i];
      }
      for(i=0;i<n-3;i++){
        if(s[i]=='x' && s[i+1]=='x'&& s[i+2]=='x')
            count++;

      else
        count;
      }
      cout<<count;

 return 0;
}

#include<bits/stdc++.h>
using namespace std;
int gcd(long long x,long long y)
{
	if(!y) return x;
	return gcd(y,x%y);

}
int main()
{
    char s[101];
    int i,j,k,n,m,ans,wns;
    cin>>n;
    for(i=1;i<=n;++i)
    {
    	scanf("%c",&s[i]);
    	if(s[i]!='x')ans=0;
    	else ans++;
    	if(ans>=3)++wns;
	}
	cout<<wns;
}

#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 1;
const int mod = 1e9 + 7;
int a[maxn];
vector<int>r;
int main(){
    int n, f;
    cin >> n;
    for(int i = 0; i < n; i ++) cin >> a[i];
    for(int i = 0; i < n; i ++){
        f = 1;
        for(int j = i + 1; j < n; j ++)
            if(a[i] == a[j]) f = 0;
        if(f>0) r.push_back(a[i]);
    }
    cout << r.size() << endl;
    for(auto x:r) cout << x << " ";
    return 0;
}

#include <iostream>
#include <string>

using namespace std ;

int main () {

	int n,len1,i=0;
	char a[101];
	bool bol ;
	cin >> n ;
	for ( int i=0 ; i<n ; i++ ) cin >> a[i] ;
	len1=n;
	do {
		bol = true ;
		for (int j=0 ; j<n-2 ; j++) {
			if (a[i]=='x' && a[i+1]=='x' && a[i+2]=='x') {
				if (i>=n-3) {
					n--;
					bol = true; ;
					break ;
				}
				else {
					for (int s=i+2 ; s<n-1 ; s++ ) {
						a[s]=a[s+1];
						--n ;
						bol = false ;
						break ;
					}
				}
			}
			break ;
		}

	} while (bol==false);
	cout << len1-n ;

	return 0;
}

#include<iostream>
#include<string.h>
using namespace std;

int main(){
	int n;
	cin >> n;
	string s;
	cin >> s;
	int i = 0;
	while(i<n){
		if(s[i]!='x'){
			break;
		}
	i++;
	}
		cout << max(0,i-2) << endl;

}

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

int n;
char s[109];
int cnt[109];
int ans;

int main(){
    scanf("%d\n",&n);
    scanf("%s",s);
    int len=strlen(s);
    if(s[0]='x') cnt[0]=1;
    for(int i=1;i<n;i++){
        if(s[i]=='x') cnt[i]=cnt[i-1]+1;
    }
    for(int i=n-1;i>=0;i--){
        if(cnt[i]>=3){
            ans+=cnt[i]-2;
            i-=cnt[i];
        }
    }
    printf("%d",ans);
    return 0;
}

#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int ans = 0;
    int l = 0;
    for (int i = 0; i < n; i++)
        if (s[i] == 'x')
            l++;
        else if (l > 0) {
            ans += (l - 2);
            l = 0;
        }
    if (l != 0)
        ans += (l - 2);
    cout << ans << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
main(){
    int n,count=0;
    cin>>n;
    string s;
    cin>>s;
    for(int i=2;i<n;i++){
        if(s[i-1]=='x'&&s[i-2]=='x')
        count ++;
    }
    cout<<count;
}

#include <iostream>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include <algorithm>
using namespace std;

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	int n,i,ans=0,max,sum=0;
	char a;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>a;
		if(a=='x')
		{
			ans++;
		}
		else
		{
			if(ans>=3)sum=sum+ans-2;
			ans=0;
		}
	}
	cout<<sum;
	return 0;
}

#define ll long long
#define loop(x,n) for(ll x = 0; x < n; x++)
#define f(n) for(ll i = 0; i < n; i++)

#include <iostream>
#include <string>
#include <unordered_map>
#include <cmath>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
    ll n; cin >> n;
    string s; cin >> s;
    ll sum = 0;

    for(int i = 0; i != n;){
        int new_i = s.find_first_not_of ('x', i+1);
        //cout << new_i << endl;
        if(new_i == string::npos){new_i = n; break;}
        if(new_i - i > 2){sum += new_i - i - 2;}
        i = new_i;
    }
    cout << sum << endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define mod 1000000007
int main(){
	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\msmut\\Documents\\Programming\\Input.txt","r",stdin);
	freopen("C:\\Users\\msmut\\Documents\\Programming\\Output.txt","w",stdout);
	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n;
	cin>>n;
	string s;
	ll c=0,ans=0;
	cin>>s;
	ll st=0;
	for(ll i=0;i<s.size();i++)
	{
		if(s[i]=='x' and st==1 and i==s.size()-1)
		{
			if(c>=3)
			{
				ans+=c-1;
			}
		}
		else if(s[i]=='x' and st==1)
		{
			c++;
		}
		else if(s[i]=='x' and st==0)
		{
			c++;
			st=1;
		}
		else if(s[i]!='x' and st==1)
		{
			if(c>=3)
			{
				ans+=(c-2);
				c=0;
				st=0;
			}
			else
			{
				c=0;
				st=0;
			}

		}

	}
	cout<<ans<<"\n";
}

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
void solve(){
	int t,cnt=0,best=0,y=0;
	cin>>t;
	string s;
	cin>>s;
	char u='x';
	for(int i=0;i<t;i++){
		if(best>=3){
			y+=abs(3-best);
		}
		if(s[i]==u){
			cnt++;
			best=max(best,cnt);
		}else{
			cnt=0;
			continue;
		}
	}cout<<y;
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	solve();
	return 0;
}

#include <bits/stdc++.h>
#define ll long long int
#define shrek() int main()
using namespace std;
shrek(){
	ll n;
	cin>>n;
	char strs[100];
	for(ll i=1;i<=n;i++){
		cin>>strs[i];
	}
	ll a=1;
	ll b=1;
	for(ll i=1;i<=n;i++){
		if(strs[i]==strs[i+1]&&strs[i+1]=='x'){
			a+=1;
			if(b<a){
				b=a;
			}
		}else{
			a=1;
		}
	}
	if(b>=3){
		cout<<b-2;
	}
	else{
		cout<<0;
	}
	return 0;
}

#include <iostream>
using namespace std;

int main()
{
	int n, l = 0, mx = 0;
	string s;
	cin >> n >> s;
	for(int i = 0; i < n; i++)
	{
		if(s[i] == 'x') l++, mx = max(mx, l);
		else mx = max(mx, l), l = 0;
	}
	if(mx > 2) cout << mx - 2;
	else cout << 0;
}

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

int main(void)
{
    int n,cnt=0;
    cin>>n;
    string s;
    while(n--)
    {
        cin>>s;
        for(int i=0;i<n;i++)
        {
            if(s[i]=='x' && s[i+1]=='x' && s[i+2]=='x')
            {
                cnt++;
            }
        }
    }
    cout<<cnt<<endl;
}

#include <iostream>
#include <string>
#include <bits/stdc++.h>

using namespace std;

#define pf printf
#define sf scanf
#define elf else if
#define Size 101

int main()
{
//    ios_base::sync_with_stdio(false);
//    cin.tie(NULL);
//    cout.tie(NULL);

    char s[Size];
    int in,len = 0,numX = 0,needToRemove = 0;
    bool tr = false;

    sf("%d",&in);
    sf("%s",s);

    for(int i = 0; i < in; i++)
    {
        if(s[i] == 'x')
        {
            numX += 1;

            if(numX == 3)
            {
                needToRemove += 1;
                numX = 0;
            }
        }

        else{
            numX = 0;
        }
    }

    printf("%d\n",needToRemove);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int cha[n];
    for(int i=0;i<n;i++)
    {
        cin>>cha[i];
    }
    int ct=0;
    vector<int > rs;
    int ans=0;
    for(int i=0;i<n;i++)
    {
        if(cha[i]=='x')
        {
            ct++;
        }
        else
        {
            if(ct>=3)
            {
                ans=ans+(ct-2);
            }
            ct=0;
        }
    }

    cout<<ans;

    return 0;
}

#include<iostream>
#include<vector>
using namespace std;
int main()
{
    int n; cin >> n;
    string s; cin >> s;
    vector<char> vec(n);
    for(int i=0;i<n;i++){
        vec[i]=s[i];
    }
    int counter=0;
    for(int i=0;i<vec.size();i++){
        if(vec[i]=='x' && vec[i+1]=='x' && vec[i+2]=='x'){
            counter++;
            vec.erase(vec.begin()+i);
            i=i-1;
            if(vec.size()<3) break;
        }
    }
    cout << counter << endl;
}

//Bismillahir Rahmanir Rahim
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,c=0;
    cin>>n;
    string s;
    cin>>s;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='x')
        {
            c++;

        }
        else
            c=0;
    }
    if(c>=3)
    cout<<c-2<<endl;
    else
        cout<<0;
}

#include <iostream>
#include <string>
using namespace std;
int main(){
    bool start=false;
    int i,j,n,a=0,b=0;
    string s;
    cin >>n >> s;
    for(i=0;i<n;i++){
        if(s[i]=='x'&&i<n-2){
            j=i;
            while(j!=n){
                if(s[j]=='x'){
                    a++;
                }
                else{
                    break;
                }
                j++;
            }
            if(a>=3){
                b+=a-2;
            }
            i = j;
        }
    }
    cout << b;
}

#include<bits/stdc++.h>
using namespace std;
char s[1000];
int i,j,k,ans,n,m;
int main()
{
	cin>>n;
	for(i=1;i<=n;++i)
	{
		cin>>s[i];
		if(s[i]=='x')++ans;
		if(ans>=3)ans=0,++m;
		if(s[i]!='x')ans=0;
	}
	cout<<m;
}

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

int main(){
    int n , count =0 , ex=0 ;
    cin >> n;
    string s ; cin >> s ;
    for( int i=0 ; ; )
    {
        if( s[i]=='x' and s[i+1]=='x' and s[i+2]=='x'){
            count += 3 ;
            ex += 3 ;
            //cout << i << endl;
            i++ ;
            //cout << i << endl;
            i++ ;
            //cout << i << endl;
            i++ ;

            if( i >=n ) break;
        }
        else{
            if( s[i]=='x' ) ex++ ;
            //cout << i << endl;
            i++ ;
            if( i>= n ) break;
        }
    }
    //cout << ex << " " << count << endl;
    //cout << ex-(count)+1 << endl;

    if( count ==0 ) cout << 0 << endl ;

    else if( count == 3 ) cout << 1 << endl;

    else if( count >3 and ex%3==0 ) cout << count-2 << endl;

    else if( count >3 and ex%3 >0 )
    {
        if( ((count/3) -1) + (ex%3) >= 3 )
            cout << count-2 + 1 << endl;
    }

    /*

    */
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int chr[n];
    for(int i=0;i<n;i++)
    {
        cin>>chr[i];
    }
    int ct=0;
    vector<int > rs;
    for(int i=0;i<n;i++)
    {
        if(chr[i]=='x')
        {
            ct++;
        }
        else
        {
            if(ct>=3)
            {
                rs.push_back(ct);
            }
            ct=0;
        }
    }

    int ans=0;
    for(int i=0;i<rs.size();i++)
    {
        ans=ans+(rs[i]-1);
    }
    cout<<ans;

    return 0;
}

#include <iostream>
#include <string>
#include <bits/stdc++.h>

using namespace std;

#define pf printf
#define sf scanf
#define elf else if
#define Size 101

int main()
{
//    ios_base::sync_with_stdio(false);
//    cin.tie(NULL);
//    cout.tie(NULL);

    char s[Size];
    int in = 0,len = 0,numX = 0,needToRemove = 0;
    bool tr = false;

    sf("%d",&in);
    sf("%s",s);

    for(int i = 0; i < in; i++)
    {
        if(s[i] == 'x')
        {
            numX += 1;

            if(numX > 3 && tr == false)
            {
                continue;
            }
        }

        else{
            tr = true;

            if(numX == 3 && tr == true)
            {
                needToRemove += 1;
                tr = false;
                numX = 0;
            }

            else{continue;}
        }
    }

    if(numX > 3)
    {
        needToRemove = numX - 2;
    }

    printf("%d\n",needToRemove);

    return 0;
}

#include <iostream>
#include<string>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include<cmath>
#include<set>
#include<vector>
#include<math.h>
#include <string.h>
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int n;
    cin >> n;
    string a;
    cin >> a;
    long long s = 0;
    int d = 1;
    for (int i = 0; i < n; i++)
    {

        if (a[i] == 'x')
        {
            for (int j = i + 1; j < n; j++)
            {

                if ((a[j] != 'x') && (j>(i+2)))
                {
                    s += j - i - 2; i = j; d--; break;
                }
                if (a[j] != 'x')
                {
                    d--; i = j; break;
                }
            }
            if (d > 0) { s = n - i - 1-1; break; }
        }

    }
    cout << s << endl;
}

#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
    int n , x , ans;
    string s ;
    cin>>n>>s;
    for(int i=0;i<=s.length();i++)
    {
        if(s[i]=='x')
            x++;
        else
            x=0;
        if(x>=3)
            ans++;

    }
    cout<<ans;
}

#include<bits/stdc++.h>
#define ll long long int
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl

using namespace std;

int main()
{
   int n,l,cnt=0,c=0;
   string s;
   cin>>n>>s;
   l=s.size();
   for(int i=0; i<l; i++)
   {
       if(s[i]=='x') cnt++;
   }
   if(cnt==l)
   {
       cout<<l-2<<endl;
   }
   else
   {
       for(int i=0; i<l-2; i=i+3)
       {
           if(s[i]=='x' && s[i+1]=='x' && s[i+2]=='x')
           {
               c++;
           }
       }
       cout<<c<<endl;
   }
}

#include<iostream>
#include<cstring>
#include<cstdio>
#include<string.h>
#include<cmath>
using namespace std;
int  main()
{
    char str[105];
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        int ans=1;
        int count=3;
        int flag=1;
        int i,j;
        scanf("%s",str);
        if(str[0]!='x'||str[1]!='x'||str[2]!='x')
        {
            printf("0\n");
            continue;
        }
        for(i=3;i<=n;i++)
        {
            if(str[i]=='x'&&flag)
            ans++;
            if(str[i]!='x')
            {
                count=0;
                flag=0;
            }
            if(str[i]=='x'&&!flag)
            {
                count++;
                if(count>=3)
                {
                    flag=1;
                    ans++;
                }
            }
        }
    printf("%d\n",ans);
    }
    return 0;
}

#include<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<utility>
#include<functional>
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	int n, res = 0;
	string s;
	cin >> n;
	cin >> s;
	int len = s.size(), ok = 0, cur ;
	for (int i = 2; i < len; i++)
	{
		if (s[i] == 'x' && s[i - 1] == 'x' && s[i - 2] == 'x' && !ok)
		{
			ok = 1;
			cur = 1;
			continue;
		}
		if (s[i] == 'x' && ok && i!=len-1)
			cur++;
		else if (s[i] == 'x'&&ok&&i == len - 1)
		{
			cur++;
			res += cur;
		}
		else if (s[i] != 'x'&& ok)
		{
			res += cur;
			ok = 0;
		}
	}
	cout << res << endl;
	return 0;
}

#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <cstdlib>
#include <algorithm>

using namespace std;

int main()
{
    int n,cont = 0,total = 0;cin>>n;
    string a;cin>>a;
    for(int i = 0;i < n-1;i++)
    {
        if(a[i] == 'x' && a [i+1]=='x')
        {
            cont++;
            if(i == n-2 && cont > 2)
                total = cont-1;
        }
        else if(a[i] == 'x')
        {
            cont = 0;
            if(cont > 1)
                total+=(cont-1);
        }

    }
    cout<<total;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <time.h>
//#include <math.h>
#include <cmath>
#include <fstream>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <stdlib.h>
#include <iomanip>
#include <cstdio>
//#include <stdio.h>

using namespace std;

#define flu fflush(stdout)
#define gg return 0
#define mp make_pair

long long mod = /*27449*/998244353;
int inf = 1e9;
double eps = 1e-2;

ifstream in("input.txt");
ofstream out("output1.txt");

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int ans = 0;
	int c = 0;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == 'x')
		{
			c++;
		}
		else
		{
			if (c != 0)
			{
				ans = max(0, c - 2);
				c = 0;
			}
		}
	}
	cout << ans;
	gg;
}

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

int main(){
    int n;
    cin>>n;
    string s;

   for(int i=0;i<n;i++){
      cin>>s[i];
   }

    int c=0;

    if(n<=2){
        cout<<0;
    }
    else{
    for(int i=0;i<n-3;i++){
        if(s[i]=='x'){
            if(s[i+1]=='x' && s[i+2]=='x')
                  c++;
        }
    }

    cout<<c;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
	string a;
	cin >> a;
	vector<int>v;
	int i,cnt=0;
	for(i=0;i<a.size();i++)
	{
		if(a[i]!='x')
		v.push_back(i+1);
	}
	if(v.size()==0)
	{
		int k=count(a.begin(),a.end(),'x');
		cout<<k-2;
	}
	if(v.size()==1)
	{
		if(v[0]-3>0)
		cnt+=v[0]-3;
		if(a.size()-v[0]-2>0)
		cnt+=a.size()-v[0]-2;
		cout<<cnt;
	}
	else
	{
		if(v[0]-3>0)
		cnt+=v[0]-3;
		if(v[v.size()-1]!=a.size())
		{
			if(a.size()-v[v.size()-1]-2>0)
			cnt+=a.size()-v[v.size()-1]-2;
		}
		for(i=1;i<v.size();i++)
		{
			if(v[i]-v[i-1]-3>0)
			cnt+=v[i]-v[i-1]-3;
		}
		cout<<cnt;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int main()
{
    int n;string a;
    cin>>n>>a;
    int l,lar,i;
    l=0;
    lar=0;
    for(i=0;i<n;i++)
    {
        if(a[i]=='x')
            l++;
        else
        {
            if(l>lar)
                lar=l;
            l=0;
        }
    }
    if(lar<3)
        cout<<"0";
    else
        cout<<lar-2;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define sz(s) (int)(s.size())
#define ll long long
#define all(s) s.begin(), s.end()
#define rep(a, b, c) for(int a = b; a <= c; ++a)
#define per(a, b, c) for(int a = b; a >= c; --a)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define open(x) freopen(x".in","r",stdin); freopen(x".out","w",stdout);
const int A=1005;

ll n,ans=-2,mx,cnt;
string s;

int main(){ _
	//open("")
	cin>>n;
	cin>>s;
	rep(i,0,n-1){
		if(s[i]=='x'){
			ans++;
		}
		else{
			ans=-2;
		}
		cnt+=mx;
		mx=max(mx,ans);
	}
	cout<<mx;

}

#include<stdio.h>

int main()
{
	char str;
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int sign =0,num = 0;
		for(int i=1;i<=n;i++)
		{
			scanf("%c",&str);
		if(str=='x')
			{
				sign++;
				if(i==n && str == 'x')
				{
					sign++;
				num+=sign-2;
			}
			}
			else {
				if(sign>2)
			{	num+=(sign-2);}
				sign =0;
			}
        }
        printf("%d\n",num);
	}
	return 0;
}

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;
int count_X(string s){
	int m = s.size();
	int k = 0;
	int kl = 0;
	for(int i=0;i<m;i++){
		if(s[i]=='x'&&i<m-1)   ++k;
		else{
			if(i==m-1&&s[i]=='x')   ++k;
			if(k>kl)   kl = k;
			k = 0;
		}
	}
	return kl;
}
bool Filename(string s){
	int m = s.size();
	for(int i=0;i<m-2;i++){
		if(s[i]=='x'&&s[i+1]=='x'&&s[i+2]=='x')   return true;
	}
     return false;
}
int main()
{
	int n;
	cin>>n;
	string s;
	s.resize(n);
	cin>>s;
	if(Filename(s))    cout<<count_X(s)-2<<endl;
	else cout<<"0"<<endl;
	return 0;

}

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n, i, co = 0;
    scanf("%d ", &n);

    char str[n];
    scanf("%s", str);

    if(str[0] != 'x' || str[1] != 'x' || str[2] != 'x'){
        printf("0\n");
        return 0;
    }

    for(i = 0; i < n - 2; i++){
        if(str[i] == 'x' && str[i + 1] == 'x' && str[i + 2] == 'x'){
            co++;
        }
    }

    printf("%d\n", co);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,p=0,q=0;
    cin>>a;
    char s;
    for(int i=0;i<a;i++)
    {
        cin>>s;
        if(s=='x')
        {
            p++;
        }
        else
        {
            if(p<=2)
            p=0;
        }
    }
   if(p==a)
   {
       cout<<a-2<<endl;
       return 0;
   }
    if(p>2&&p<a)
    {
        for(int i=1;i<=p;i++)
        {
            p=p-i;
            if(p==2)
            {
                cout<<i<<endl;
            }
        }
    }
    else
    {
        cout<<"0"<<endl;
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int a=0,b,c,d;
    while(s.find("xxx")!=-1){
        b=s.find("xxx");
        s.erase(b,1);
        a++;
    }
    cout<<a;
}

#include<iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main() {

int n;
cin>>n;
string s;
cin>>s;
int k=0,r=0;
for (int i=0;i<n;i++){
     if (s[i]=='x'){
          k++;
     }else{
          if (k>2){
               r=k-2;
          }
          k=0;
     }

}
if (k>2){
     r+=k-2;
}

cout<<r;

}

#include <iostream>
#include <string>
#include<algorithm>
#include <cstdio>
#include <vector>
#include<numeric>
using namespace std;

void main()
{

	int n,b=0,k=0;
	string s;
	cin >> n >> s;
	int t = count(s.begin(), s.end(), 'x');
	if (t > 2)
		for (size_t i = 1; i < n - 1; i++)
		{
			if (s[i] == 'x' && s[i - 1] == 'x' && s[i + 1] == 'x' && k == 0) { k = 1; i += 2; b += 1; }
	        else k = 0;
			while (k==1 && i<n-1)
			{
				if (s[i] == 'x')
				{
					i += 1;
					++b;
				}
				else k = 0;

			}
	}

	cout << b;

}

#include<bits/stdc++.h>
using namespace std;
main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int count  = 0,ans = 0,flag = 0;
	s = s + '1';
	for(int i=0; i<n; i++)
	{
		if(s[i] == 'x')
		{
			if(s[i+1] == 'x')
				count++;
			if(s[i+1] != 'x' && count >2)
			{
				count++;
				ans = count - 2;
				count = 0;
				flag = 1;

			}
		}

	}
	if(flag = 1)
		cout << ans;
	else
		cout << count;
}

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n,b=0,c=1;
	string a;
	cin>>n;
	for(int i=0; i<n; i++)
		while(cin>>a[i]){
		 if(a[i]=='x') {
			 b+=1;
	break;}
else {
	if(b>=3) c=b-2;
	b=0;
	break;
}}
if(b==n-1) cout<<b-2;
else
cout<<b-2*c;
return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int a,i,j=0,k=0;
    string b;
    cin>>a>>b;
    for(i=0;i<a;i++)
    {
        if(b[i]=='x'){j++;}
        else if(b[i]!='x'){if(j>2){k++;j=0;}else{j=0;}}
    }
    if(k){cout<<k;}
    else{cout<<j-2;}
}

#include <iostream>
#include <string>
using namespace std;
int main()
{
	int n,c;
	cin>>n;
	string h;
	cin>>h;
	for (int i=0; i<n; i++)
	{
		if(h[i]=='x')
			c++;
		if (h[i+1]=='x')
			c++;
		if (h[i+2]=='x')
			c++;
	}
	if(c!=0)
		cout<<c;
	if (c==0)
		cout<<"0";
}

#include <iostream>
#include <vector>
#include <cstdio>
#include <string>

#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n

using namespace std;

using std::cout;
using std::cin;
using std::vector;
using std::pair;
using std::string;
using std::ios_base;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

int32_t main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int N;
	cin >> N;

	string message;
	cin >> message;

	int num_removals = 0;

	int num_x = 0;
	bool other_found = false;
	for (int i = 0; i < N; i++)
	{
		if (message[i] != 'x' && num_x >= 3)
		{
			other_found = true;
			num_removals += num_x - 2;
			num_x = 0;
		}
		else
			num_x++;
	}

	if (!other_found)
		num_removals += num_x - 2;
	cout << num_removals << "\n";
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,count=0,countt=0,j=0,k=0;
    cin>>n;
    string s;
    cin>>s;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='x'){
            count++;
            k=k+count;}
        else
        {
            countt++;
            count=0;
        }
    }
    while(k>2)
    {
        j++;
        k--;
    }
    cout<<j<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    string s;
    cin>>n>>s;
    int k=0;
    int maxx=0;
    int ans=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='x')
        {
        k++;
            maxx=max(maxx,k);
        }
        else
        {
            ans+=k-2;
            k=0;
        }
    }
    cout<<k;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
string s;
cin>>s;
int k;
int ans=0;
for(int i=0;i<n;i++)
{
if(s[i]=='x')
{
k=i;
while(s[i]==s[k])
{
k++;
}
if(k-i>=3)
{
ans+=k-2;
}
i=k-1;
}
}
cout<<ans<<endl;
}

#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <set>
#include <vector>
#include <map>

using namespace std;

int main()
{
#ifdef MY_DEBUG
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  int n, k;
  cin >> n >> k;
  vector<vector<int> > v(4);
  for(int i = 0; i < v.size(); i++)
  {
    v[i].resize(n, 0);
  }

  if(k == 2 * (n - 2))
  {
    for(int i = 1; i < 3; i++)
    {
      for(int j = 1; j < n-1; j++)
      {
        v[i][j] = '#';
      }
    }
  }
  else
  {
    bool fl = false;
    for(int i = 1; i < 3; i++)
    {
      if(fl)
        break;
      for(int j = 1; j < n / 2; j++)
      {
        if(k > 1)
        {
          v[i][j] = v[i][n - j - 1] = 1;
          k-=2;
        }
        else
        {
          fl = true;
          break;
        }
      }
    }
  }

  if (k == 1)
  {
    v[2][n / 2] = 1;
    k--;
  }

  cout << "YES" << endl;
  for(int i = 0; i < 4; i++)
  {
    for(int j = 0; j < n; j++)
    {
      if(v[i][j] == 0)
        cout << '.';
      else
        cout << '#';
    }
    cout << endl;
  }

  return 0;
}

#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
    int n , x , ans;
    string s ;
    cin>>n>>s;
    for(int i=0;i<=s.length();i++)
    {
        if(s[i]=='x')
            x++;
        else
            x=0;
        if(x>3)
            ans++;

    }
    cout<<ans;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    string s;
    cin>>n>>s;
    int k=0;
    int maxx=0;
    int ans=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='x')
        {
        k++;
            maxx=max(maxx,k);
        }
        else
        {   if(k>=3)
            ans+=k-2;
            k=0;
        }
    }
    cout<<ans;
}

#include<bits/stdc++.h>
using namespace std;
char s;
int main()
{
    int n,k=0,min1=0,p=1;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>s;
        if(s=='x'){
            k++;
            p=0;
        }else{
            if(p==0){
            min1+=k-2;
            if(n==100){
            cout<<'+'<<k;}

            k=0;
            p=1;}
        }
    }
    if(p==0){
    min1+=k-2;}
    if(min1<0)cout<<0;else
    cout<<min1;
}

#include <bits/stdc++.h>
#include <numeric>
using namespace std;
int main() {
    int n ,count=0;
    cin >> n;
    string x;
    cin >> x;
    for(int i=0;i<n;++i)
    {
        if(x[i]=='x')
        {
            count++;
        }
    }
    if(count>2)
    cout<<(count-2);
    else
        cout<<0;
    }

#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define jig_saw ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
jig_saw
ll n , cnt=0,ans=-1,sum=0,k;
cin >> n;
string s;
ll a[n+5],b[n+4] ,count=0;
 cin >> s;
 for (int i=0;i<n;i++)
 {
     if (s[i]=='x')
     {
         count++;
     }
     else {ans = max(ans,count-3+1); count = 0;     }
 }
 if (ans==-1){ ans = max(ans ,count-3+1);}
 if (ans<0){ans=0;}
 cout << ans;
return 0;
}

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<map>

using namespace std;
map<int,int> m;
int main()
{
    int n;
    cin>>n;
    getchar();
    char str[111];
    cin>>str;
    int cnt=0,ans=0,flag=0;
    for(int i=0;i<n;i++)
    {
        if(str[i]=='x')
        {
            cnt++;
            flag=1;
        }
        else if(cnt!=0&&str[i]!='x')
        {
            ans+=cnt-2;
            cnt=0;
        }
        if(str[i]=='x'&&i==n-1&&cnt>=3)
        {
            ans+=cnt-2;
        }
    }
    if(!flag)
        cout<<"0"<<endl;
    else
        cout<<ans<<endl;
    return 0;
}

#include <iostream>
#include<string>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include<cmath>
#include<set>
#include<vector>
#include<math.h>
#include <string.h>
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int n;
    cin >> n;
    string a;
    cin >> a;
    long long s = 0;
    int d = 1;
    for (int i = 0; i < n; i++)
    {

        if (a[i] = 'x')
        {
            for (int j = i + 1; j < n; j++)
            {
                if (a[j] != 'x')
                    d--;
                if ((a[j] != 'x') && (j - i > 2))
                {
                    s += j - i - 2; i = j; d--; break;
                }
            }

        }
        if (d) { s = n - 1 -1; break; }
    }
    cout << s << endl;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int q;
    int c=0;
    int b=0;
    vector <int> a;
    cin>>q;
    string s;
    cin>>s;

    for(int i=0; i<q; i++){
        if(s[i]=='x'){
            a.push_back(s[i]);
        }
        else{
            a.push_back(' ');
        }
    }
    for(int i=0; i<q; i++){
        if(a[i]=='x'){
           c+=1;
           if(c==q){
                cout<<q-2;
           }
        }
        else{
            if(c!=0){
                if(c>=3){
                   c=c-(c-1);
                   cout<<c;
                }
                else{
                    cout<<0;
                }
            }
            c=0;
        }
    }
    for(int i=0; i<q; i++){
        if(a[i]==' '){
            b+=1;
            if(b==q){
                cout<<0;
            }
        }
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main () {
	int n,cnt=0,g=-1,d,k=0;
	cin>>n;
	char b;
	string s="";
	for (int i=0; i<n; i++)
	   {
	   	   cin>>b;
	   	   s=s+b;
	   }

	while (n>0)
	{
	for (int i=g+1; i<s.size(); i++)
	    {
	    	if (s[i]=='x')
	    		g=i;
	    	else
	    	break;
		}
	  	d=g-cnt;
	  	cnt=g;
	  	if (d>=2)
	  	  k=k+d-1;
	  	if (cnt==s[s.size()-1])
	  	   break;

    n--;
    }
    cout<<k;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
main()
{
   string str;
   int n,c=0;
   cin>>n>>str;
   for(int i=0;str[i]!='\0';i++)
   {
       if(str[i]=='x'&&str[i+1]=='x'&&str[i+2]=='x')
       {
           str[i]='3';
           c++;
       }
   }
   cout<<c<<endl;
   for(int i=0;str[i]!='\0';i++)
   {
       if(str[i]!='3')cout<<str[i];
   }
}

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

int main() {
    string s;
    int ans = 0;

    cin >> s;
    int cnt = 0;
    for(auto& i: s) {
        if(i != 'x') {
            if(cnt > 2) ans += cnt - 2;
            cnt = 0;
        } else cnt ++;
    }

    cout << ans << endl;
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
	char a[101];
	int b[20]={0};
	int n,c=0,flag=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cout<<endl;
	/*for(int i=0;i<n;i++)
	{
		cout<<a[i];
	}*/
	int j=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]=='x')
		{
			c++;
		}
		else
		{
			flag = 1;
			b[j]=c;
			j++;
			c=0;
		}
		if(flag == 0)
		{
			b[j]=c;
		}
	}
	/*for(int i=0;i<n;i++)
		cout<<b[i];*/
	int sum=0,d;
	for(int i=0;i<n;i++)
	{
		if(b[i]>=3)
		{
			d = b[i]-2;
			sum = sum + d;
		}
	}
	if(sum==0)
		cout<<'0';
	else
		cout<<sum;

	return 0;
}

#include<bits/stdc++.h>
#include <sstream>
using namespace std;
int main()
{
   int k=0,t=0,flag=0,n;
   cin>>n;
   string a;
   cin>>a;
   for(int i=0;i<a.size();i++)
   {
       if(a[i]=='x')
       {
           k++;
       }
       else
       {
           if(k>=3)
           {
                t=k-2;
                flag=1;
           }
           k=0;
       }
   }
   if(flag==0)
   {
       t=k-2;
   }
   cout<<t;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,count=0,countt=0,j=0,k;
    cin>>n;
    string s;
    cin>>s;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='x'){
            count++;
            k=count;}
        else
        {
            countt++;
            count=0;
        }
    }
    while(k>2)
    {
        j++;
        k--;
    }
    cout<<j<<endl;
}

#include<cstdio>
#include<algorithm>
#include<cctype>
#include<cstring>
#include<iostream>
#include<cmath>
#define LL long long
#define INF (2139062143)
#define N (100005)
using namespace std;
int n,tot,ans;
char c[N];
template <typename T> void read(T&t) {
	t=0;
	bool fl=true;
	char p=getchar();
	while (!isdigit(p)) {
		if (p=='-') fl=false;
		p=getchar();
	}
	do {
		(t*=10)+=p-48;p=getchar();
	}while (isdigit(p));
	if (!fl) t=-t;
}
int main(){
	read(n);
	scanf("%s",c+1);
	for (int i=1;i<=n;i++){
		if (i==1||c[i]!='x'){
			if (tot>2) ans+=tot-2;
			tot=0;
		}
		else tot++;
	}
	if (tot>2) ans+=tot-2;
	printf("%d",ans);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
string x,y;
int i,n,a,b,k;
int main (){
cin>>a>>y;
for (i=a; i>=0; i--){
    if (y[i]==120) k++;
    else { k=0;continue;}
    if (k==3) {y.erase(i,1); b++; k=0;}

}
cout<<b;
}

#include <bits/stdc++.h>
#define maxn 120
#define inf 0x3f3f3f3f
using namespace std;
int n,ct;
char s[maxn];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>s[i];
		if(s[i]=='x')	ct++;
	}
	if(n<=2){
		cout<<0<<endl;
		return 0;
	}
	if(ct==n){
		cout<<n-2<<endl;
		return 0;
	}
	int cnt=0;
	for(int i=3;i<=n;i++){
		if(s[i]=='x'&&s[i-1]=='x'&&s[i-2]=='x'){
			cnt++;
			s[i]='o';
		}
	}
	cout<<cnt<<endl;
	return 0;
}

#include <iostream>
#include <string>
// #include <cstdlib>
// #include <cmath>
#include <array>
// #include <vector>
// #include <algorithm>
// #include <set>
// #include <map>

using namespace std;

int main(){
	int n;
	cin >> n;

	string error;
	cin >> error;

	int remove_x = 0;
	int xcnt = 0;

	for(int i = 0; i < n; i++){
		if(error[i] == 'x'){
			xcnt++;
		}
		else{
			// cout << "x=" << xcnt << endl;
			if(xcnt >= 3){
				remove_x += (xcnt - 2);
			}
			xcnt = 0;
		}

	}
	cout << remove_x << endl;
}

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

int main()
{
    int n,count=0;
    cin>>n;
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        if(s.at(i)=='x')
        {
            count++;
        }
    }
    if(count<3)
    {
        cout<<"0"<<endl;
    }
    else
        cout<<count-2<<endl;

       return 0;
}