Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,i,c=0,ans=0;
- cin>>n;
- string str;
- cin>>str;
- for(i=0; i<n; i++)
- {
- if(str[i]=='x' && str[i+1]=='x' && str[i+2]=='x')
- c++;
- }
- cout<<c<<endl;
- }
Add Comment
Please, Sign In to add comment