-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB.cpp
More file actions
32 lines (29 loc) · 833 Bytes
/
Copy pathB.cpp
File metadata and controls
32 lines (29 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <bits/stdc++.h>
using namespace std;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define sep ' '
#define debug(x) cerr << #x << " = " << x << endl
#define getarr(arr, y) for(int i = 0; i < y; i++) cin >> arr[i]
#define printarr(arr, y) for(int i = 0; i < y; i++) cerr << i << " = " << arr[i] << endl
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;
vector<int> nx;
int main(){
fast_io;
int n;
str a;
cin >> n >> a;
nx.push_back(-1);
for(int i = 0; i < n; i ++){
if(a[i] != 'x') nx.push_back(i);
}
int t = 0;
nx.push_back(n);
for(int i = 1; i < nx.size(); i ++){
t += (nx[i] - nx[i-1] - 1 >= 3 ? nx[i] - nx[i-1] - 1 - 2 : 0);
}
cout << t;
return 0;
}