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".


-----Input-----

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.


-----Output-----

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.


-----Examples-----
Input
6
xxxiii

Output
1

Input
5
xxoxx

Output
0

Input
10
xxxxxxxxxx

Output
8



-----Note-----

In 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.

Difficulty: EASY

Solutions:
n = int(input())
line = input()
ans = 0
inARow = 0
for a in line:
	if a == 'x':
		inARow += 1
		if inARow > 2:
			ans += 1
	else:
		inARow = 0
print(ans)


n = int(input())
s = str(input())
x = 0
for i in range(n - 2):
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		x += 1
print(x)


charNum = int(input())
string = input()
k = 0
while string.find('xxx') != -1:
	string = string[:string.find('xxx')] + string[string.find('xxx') + 1:]
	k += 1
print(k)


def ans():
	N = int(input())
	A = input()
	Ans = 0
	for j in range(len(A) - 2):
		for i in range(j, j + 3):
			if A[i] != 'x':
				break
		else:
			Ans += 1
	print(Ans)
ans()


n = int(input())
s = input()
k = 0
for i in range(n):
	if s[i:i + 3] == 'xxx':
		k += 1
print(k)


n = int(input())
s = list(input())
c = 0
for i in range(n):
	if s[i:i + 3].count('x') == 3:
		c = c + 1
print(c)


n = int(input())
name = input()
count = 0
for i in range(n):
	if i + 2 <= n - 1:
		if name[i] == 'x' and name[i + 1] == 'x' and (name[i + 2] == 'x'):
			count += 1
print(count)


def solve(s):
	w = ['_', '_', '_']
	forbidden = ['x', 'x', 'x']
	offset = 0
	answer = 0
	for c in s:
		w[offset % 3] = c
		if w == forbidden:
			answer += 1
		else:
			offset += 1
	print(answer)
if '__main__' == __name__:
	n = int(input())
	solve(input()[:n])


result = 0
n = int(input())
string = list(input())
for i in range(2, n):
	if string[i] == 'x' and string[i - 1] == 'x' and (string[i - 2] == 'x'):
		result += 1
print(result)


import sys
sys.setrecursionlimit(10000000)
mod = 10 ** 9 + 7
INF = float('inf')
from sys import stdin
readline = stdin.readline

def readInts():
	return list(map(int, readline().split()))

def readTuples():
	return tuple(map(int, readline().split()))

def I():
	return int(readline())
n = I()
S = input()
lis = []
i = 0
cnt = 0
ans = 0
while i < n:
	if S[i] != 'x':
		ans += max(0, cnt - 2)
		cnt = 0
	else:
		cnt += 1
	i += 1
ans += max(0, cnt - 2)
print(ans)


n = int(input())
s = input()
ans = 0
while True:
	s1 = s.replace('xxx', 'xx', 1)
	if s1 != s:
		ans += 1
		s = s1
	else:
		break
print(ans)


input()
t = input() + 'a'
lis = []
cnt = 0
for i in range(len(t)):
	if t[i] == 'x':
		cnt += 1
	else:
		if cnt > 2:
			lis.append(cnt)
		cnt = 0
print(sum(lis) - 2 * len(lis))


n = int(input())
s = input()
(ans, c, flag) = (0, 0, 0)
for i in range(n):
	if s[i] == 'x':
		if flag == 1:
			c += 1
		else:
			c = 1
			flag = 1
	else:
		if flag == 1 and c >= 3:
			ans += c - 2
		flag = 0
		c = 0
if flag == 1 and c >= 3:
	ans += c - 2
print(ans)


n = input()
l = input()
c = 0
while True:
	if 'xxx' in l:
		l = l.replace('xxx', 'xx', 1)
		c += 1
	else:
		break
print(c)


n = int(input())
s = input()
countx = 0
solution = 0
for i in s:
	if i == 'x':
		countx += 1
		if countx >= 3:
			solution += 1
	else:
		countx = 0
print(solution)


n = int(input())
s = input()
ans = 0
for i in range(n):
	if s[i] == 'x' and (i == 0 or s[i - 1] != 'x'):
		j = i
		while j + 1 < n:
			if s[j + 1] == 'x':
				j += 1
			else:
				break
		sz = j - i + 1
		ans += max(0, sz - 2)
print(ans)


n = int(input())
s = input()
a = s[0]
b = s[1]
k = 0
for i in range(2, n):
	c = s[i]
	if a + b + c == 'xxx':
		k += 1
	a = b
	b = c
print(k)


size_a = int(input())
a = input()
i = 0
tap = 0
summ = 0
while i < size_a:
	if i < size_a - 1:
		if a[i] == 'x' and a[i + 1] == 'x':
			tap += 1
		elif a[i] == 'x' and a[i + 1] != 'x':
			tap += 1
			if tap >= 3:
				summ += tap - 2
			tap = 0
	elif a[i] == 'x' and tap != 0:
		tap += 1
		if tap >= 3:
			summ += tap - 2
		tap = 0
	i += 1
print(summ)


import re

def main():
	input()
	line = input().strip()
	res = re.findall('x{3,}', line)
	if not res:
		print(0)
		return
	ans = 0
	for s in res:
		ans += len(s) - 2
	print(ans)
main()


num = int(input())
lst = str(input())
lst = [str(x) for x in str(lst)]
matches = []
matches_arr = []
for item in lst:
	if item == 'x':
		matches_arr.append('x')
	else:
		if len(matches_arr) > 2:
			matches.append(matches_arr)
		matches_arr = []
if len(matches_arr) > 2:
	matches.append(matches_arr)
	matches_arr = []
remove_count = 0
for item in matches:
	if len(item) == 3:
		remove_count += 1
	elif len(item) > 3:
		remove_count += len(item) - 2
print(remove_count)


n = int(input())
string = input()
buckets = []
curr_bucket = 0
for i in range(n):
	if string[i] == 'x':
		curr_bucket += 1
	elif curr_bucket > 0:
		buckets.append(curr_bucket)
		curr_bucket = 0
if curr_bucket > 0:
	buckets.append(curr_bucket)
ans = 0
for i in range(len(buckets)):
	if buckets[i] > 2:
		ans += buckets[i] - 2
print(ans)


n = int(input())
s = [c for c in input()]
i = ans = 0
while i < len(s) - 2:
	ss = s[i] + s[i + 1] + s[i + 2]
	if ss == 'xxx':
		s.pop(i + 2)
		ans += 1
		i -= 1
	i += 1
print(ans)


import sys
input = sys.stdin.readline
n = int(input())
test_str = str(input())
countXXX = 0
count = 0
for i in test_str:
	if i == 'x':
		countXXX += 1
	else:
		countXXX = 0
	if countXXX == 3:
		count += 1
		countXXX -= 1
print(count)


n = int(input())
a = list(input())
count = 0
for i in range(n - 2):
	if a[i] == 'x' and a[i + 1] == 'x' and (a[i + 2] == 'x'):
		count += 1
print(count)


n = int(input())
s = input()
while 'xxx' in s:
	s = s.replace('xxx', 'xx')
print(n - len(s))


n = int(input())
s = input()
c = k = 0
for i in s:
	if i == 'x':
		c += 1
	else:
		c = 0
	if c > 2:
		k += 1
print(k)


n = int(input())
strs = input()
ans = 0
count = 0
for i in strs:
	if i == 'x':
		count += 1
	if i != 'x':
		if count >= 3:
			ans += count - 2
		count = 0
if count >= 3:
	ans += count - 2
print(ans)


def file_name(x):
	if x is None:
		print(0)
	(x_count, count_xxx) = (x.count('x'), 0)
	if x_count == 0:
		return 0
	for i in range(2, len(x)):
		if x[i - 2:i + 1] == 'xxx':
			count_xxx += 1
	return count_xxx
s = int(input())
x_str = str(input())
print(file_name(x_str))


n = int(input())
s = input()
ans = ''
for i in range(n):
	if not (len(ans) > 1 and 'x' == s[i] == ans[-1] == ans[-2]):
		ans += s[i]
print(n - len(ans))


n = int(input())
s = input()
d = 0
for i in range(n - 2):
	if s[i:i + 3] == 'xxx':
		d += 1
print(d)


n = int(input())
a = input()
c = 0
d = []
for i in range(n):
	if a[i] == 'x':
		c = c + 1
	elif c != 0:
		d.append(c)
		c = 0
if c != 0:
	d.append(c)
	c = 0
s = 0
for i in range(len(d)):
	if d[i] > 2:
		s = s + d[i] - 2
print(s)


n = int(input())
s = str(input())
count = 0
su = 0
for i in range(n):
	if s[i] == 'x':
		count = count + 1
	else:
		if count >= 3:
			su = su + count - 2
		count = 0
if count >= 3:
	su = su + count - 2
	count = 0
print(su)


n = int(input())
inputStr = input()
ans = 0
k = inputStr.find('xxx')
while k >= 0:
	if k == 0:
		inputStr = inputStr[1:len(inputStr)]
		ans = ans + 1
	else:
		inputStr = inputStr[0:k] + inputStr[k + 1:len(inputStr)]
		ans = ans + 1
	k = inputStr.find('xxx')
print(ans)


x = int(input())
t = input()
t1 = 0
r = 0
for i in range(x):
	if t[i] == 'x':
		r = r + 1
	else:
		r = 0
	if r >= 3:
		t1 = t1 + 1
print(t1)


n = int(input())
s = input()
k = 0
line = 0
if 'xxx' in s:
	for i in range(len(s)):
		if s[i] == 'x':
			if line < 2:
				line += 1
			else:
				k += 1
		else:
			line = 0
	print(k)
else:
	print(0)


n = int(input())
st = list(input())
l = []
i = 0
while i < n:
	x = st[i]
	if x == 'x':
		c = 0
		for j in range(i, n):
			if x == st[j]:
				c += 1
				i += 1
			else:
				break
		l.append(c)
	i += 1
c = 0
for i in l:
	if i >= 3:
		c += i - 2
print(c)


n = int(input())
a = input()
c = 0
for i in range(len(a)):
	if a[i:i + 3] == 'xxx':
		c = c + 1
print(c)


in1 = int(input())
in2 = input()
k = 0
for i in range(in1 - 2):
	if in2[i:i + 3] == 'xxx':
		k = k + 1
print(k)


n = int(input())
s = input()
count = 0
i = 0
while i < n - 1:
	if s[i] != 'x':
		i += 1
	else:
		if s[i] == 'x':
			for j in range(i + 1, n):
				if s[j] != 'x':
					break
				else:
					j = n
		if j - i == 3:
			count += 1
		elif j - i > 3:
			count += j - i - 2
		i = j
print(count)


n = int(input())
s = input()[:n]
ans = 0
count = 0
for i in range(n):
	if s[i] == 'x':
		count += 1
		if count >= 3:
			ans += 1
	else:
		count = 0
print(ans)


import sys
k = int(input())
s = input()
if 'xxx' not in s:
	print(0)
	sys.exit()
(c, d) = (0, 0)
for i in range(len(s)):
	if s[i] == 'x':
		d += 1
		if d >= 3:
			c += 1
	else:
		d = 0
print(c)


n = int(input())
s = input()
l = []
i = 0
c = 0
while i < len(s) - 1:
	if s[i] == 'x' and s[i + 1] == 'x':
		c += 1
	elif s[i] == 'x' and s[i + 1] != 'x':
		l.append(c + 1)
		c = 0
	i += 1
if s[i] == 'x':
	l.append(c + 1)
co = 0
for i in l:
	if i >= 3:
		co += i - 2
print(co)


l = int(input())
a = input()
c = rm = 0
for i in range(l):
	if a[i] == 'x' and c == 0:
		(b, c) = (i, 1)
	elif a[i] != 'x' and c == 1:
		d = i
		rm += d - b - 2 if d - b >= 3 else 0
		c = 0
if a[-1] == 'x':
	rm += l - b - 2 if l - b >= 3 else 0
print(rm)


n = int(input())
a = input()
g = 0
for i in range(n - 2):
	if a[i] == a[i + 1] == a[i + 2] == 'x':
		g += 1
print(g)


n = int(input())
a = list(input())
b = []
count = 0
for i in range(n):
	if a[i] == 'x':
		count += 1
		if count >= 3:
			b.append(a[i])
	else:
		count = 0
print(len(b))


n = int(input())
a = input()
m = 0
s = 0
for i in a:
	if i == 'x':
		s = s + 1
		if s > 2:
			m = m + 1
	else:
		s = 0
print(m)


n = int(input())
s = list(input())
res = 0
var = 0
for i in s:
	if i == 'x':
		var += 1
	else:
		var = 0
	if var > 2:
		res += 1
print(res)


t = int(input())
st = input()
c = 0
j = 0
if st[0] == 'x':
	j = 1
for i in range(1, t):
	if st[i] == 'x':
		if st[i - 1] == 'x':
			j += 1
		else:
			j = 1
	elif j >= 3:
		c += j - 2
		j = 0
if j >= 3:
	print(c + j - 2)
else:
	print(c)


(n, s) = (input(), input())
res = 0
while 'xxx' in s:
	i = s.find('xxx')
	s = s[:i] + s[i + 1:]
	res += 1
print(res)


n = int(input())
st = input()
count = 0
maxlen = 0
for i in st:
	if i == 'x':
		count += 1
	else:
		if count >= 3:
			maxlen += count - 2
		count = 0
if count >= 3:
	maxlen += count - 2
print(maxlen)


n = int(input())
s = input()
c = 0
p = 0
for i in range(len(s)):
	if s[i] == 'x':
		c += 1
	else:
		c = 0
	if c >= 3:
		p += 1
print(p)


a = input()
n = input().lower()
k = 0
for i in range(int(a) - 2):
	if n[i] == 'x' and n[i + 1] == 'x' and (n[i + 2] == 'x'):
		k += 1
print(k)


from sys import stdin
n = int(stdin.readline().rstrip())
file = stdin.readline().rstrip()
s = []
c = 0
for char in file:
	s.append(char)
	if len(s) > 2 and s[-1] == 'x' and (s[-2] == 'x') and (s[-3] == 'x'):
		s.pop()
		c += 1
print(c)


n = int(input())
s = list(input())
ct = 0
for i in range(len(s) - 2):
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		ct += 1
print(ct)


f = lambda s: f(s.replace('xxx', 'xx')) if 'xxx' in s else s
print(int(input()) - len(f(input())))


n = int(input().strip())
inp = input().strip()
l = []
i = 0
while i < n:
	if i < n and inp[i] == 'x':
		count = 0
		while i < n and inp[i] == 'x':
			count += 1
			i += 1
		l.append(count)
	else:
		i += 1
ans = 0
for i in l:
	if i > 2:
		ans += i - 2
print(ans)


length = int(input())
string = input()
ans = 0
currentXcount = 0
for i in range(length):
	if string[i] == 'x':
		currentXcount += 1
		if currentXcount >= 3:
			ans += 1
	else:
		currentXcount = 0
print(ans)


import re
n = int(input())
strings = input()
num = 0
pat = '[x]{3,}'
erList = re.compile(pat).findall(strings)
for i in erList:
	num += len(i) - 2
print(num)


n = int(input())
s = input()
i = 0
c = 0
while i < n:
	if s[i] == 'x':
		j = i + 1
		x = 1
		while j < n and s[j] == 'x':
			j = j + 1
			x = x + 1
		if x > 2:
			c = c + x - 2
		i = j
	else:
		i = i + 1
print(c)


def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def si():
	return input()
n = ii()
s = si()
ans = 0
c = 0
for i in range(n):
	if s[i] == 'x':
		c += 1
		if c == 3:
			ans += 1
			c -= 1
	else:
		c = 0
print(ans)


t = int(input())
s = list(input())
c = 0
i = 0
while i < t - 2:
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		c = c + 1
	i = i + 1
print(c)


n = int(input())
a = input()
b = []
i = 0
while i < len(a):
	if a[i] == 'x':
		j = i + 1
		while j < len(a) and a[j] == 'x':
			j += 1
		b.append(j - i)
		i = j
	else:
		i += 1
c = [max(i - 2, 0) for i in b]
print(sum(c))


t = int(input())
s = input()
tc = 0
i = 0
while i < len(s):
	c = 0
	while i < len(s) and s[i] == 'x':
		c += 1
		i += 1
	if c > 2:
		tc = tc + c - 2
	i += 1
print(tc)


length = int(input())
name = input()
count = 0
ans = 0
for i in name:
	if i == 'x':
		count += 1
	else:
		count = 0
	if count > 2:
		ans += 1
print(ans)


n = int(input())
s = input()
cc = 0
t = 0
for char in s:
	if char == 'x':
		cc += 1
	else:
		if cc >= 3:
			t += cc - 2
		cc = 0
if cc >= 3:
	t += cc - 2
print(t)


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
N = INT()
S = input()
A = []
cnt = 1
for i in range(N - 1):
	if S[i] == S[i + 1]:
		cnt += 1
	else:
		A.append((S[i], cnt))
		cnt = 1
A.append((S[-1], cnt))
ans = 0
for (s, cnt) in A:
	if s == 'x':
		ans += max(cnt - 2, 0)
print(ans)


n = int(input())
s = input()
res = 0
for i in range(2, len(s)):
	if s[i - 2] == s[i - 1] == s[i] == 'x':
		res += 1
print(res)

def templ():
	from pprint import pprint
	q = int(input())
	for _ in range(q):
		s = input()
		n = int(input())
		(n, k) = map(int, input().split())
		dat = list(map(int, input().split()))
	dat = [1, 2, 3]
	print(' '.join(list(map(str, res))))
	pass
	import math
	math.ceil(1.2)
	math.floor(1.2)
	round(1.2, 3)


N = input()
file_name_length = int(N)
file_name = input()
stretch_x_length = 0
del_count = 0
for c in file_name:
	if c == 'x':
		stretch_x_length += 1
	else:
		if stretch_x_length > 2:
			del_count += stretch_x_length - 2
		stretch_x_length = 0
if stretch_x_length > 2:
	del_count += stretch_x_length - 2
print(del_count)


n = int(input())
string = input()
answer = 0
count = 0
for i in range(len(string)):
	if string[i] != 'x' and count >= 3:
		answer += count - 2
		count = 0
	elif string[i] != 'x':
		count = 0
	elif string[i] == 'x':
		count += 1
if count >= 3:
	answer += count - 2
print(answer)


n = int(input())
s = input()
i = 0
ans = 0
while True:
	j = 0
	while s[i] == 'x':
		i += 1
		j += 1
		if i == n:
			break
	ans += max(0, j - 2)
	i += 1
	if i >= n:
		break
print(ans)


n = int(input())
str1 = input()
list1 = list(str1)
count = 0
while True:
	len1 = len(list1)
	for i in range(len1 - 2):
		if list1[i] == 'x' and list1[i + 1] == 'x' and (list1[i + 2] == 'x'):
			list1.pop(i + 2)
			count += 1
			break
	len2 = len(list1)
	if len1 == len2:
		break
print(count)


n = int(input())
a = input()
s = 0
q = 0
for i in range(len(a)):
	if a[i] == 'x':
		s += 1
	else:
		s = 0
	if s == 3 and a[i] == 'x':
		s -= 1
		q += 1
print(q)


l = int(input())
a = input()
b = []
x = 'x'
for i in range(l):
	b.append(a[i])
f = 0
i = 2
while i != len(b):
	if b[i] == 'x' and b[i - 1] == 'x' and (b[i - 2] == 'x'):
		b.pop(i)
		f += 1
	else:
		i += 1
print(f)


from collections import Counter, defaultdict
BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from math import floor, ceil, pi
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919]

def primef(n, plst=[]):
	if n == 1:
		return plst
	else:
		for m in primes:
			if n % m == 0:
				return primef(n // m, plst + [m])
		return primef(1, plst + [n])

def lmii():
	return list(map(int, input().split()))

def ii():
	return int(input())

def countOverlapping(string, sub):
	count = start = 0
	while True:
		start = string.find(sub, start) + 1
		if start > 0:
			count += 1
		else:
			return count
n = ii()
s = list(input())
pos = 0
cur = 0
done = 0
while pos < len(s):
	if s[pos] == 'x':
		cur += 1
		if cur == 3:
			done += 1
			cur -= 1
	else:
		cur = 0
	pos += 1
print(done)


import sys
from collections import *
input = sys.stdin.readline
n = int(input())
s = 0
a = input()
c = 0
for i in a:
	if i == 'x':
		c += 1
	else:
		s += max(0, c - 2)
		c = 0
print(s)


n = int(input())
string = input()
if string.find('xxx') == -1:
	print(0)
else:
	consecutive = []
	count = 0
	for i in range(n):
		if string[i] == 'x':
			count += 1
		if string[i] != 'x':
			if count >= 3:
				consecutive.append(count)
			count = 0
	if count >= 3:
		consecutive.append(count)
	count = 0
	for i in consecutive:
		if i != 0:
			count += i - 2
	print(count)


n = int(input())
x = input()
ans = 0
temp = 0
for i in x:
	if i == 'x':
		temp += 1
	else:
		if temp > 2:
			ans += temp - 2
		temp = 0
if x[-1] == 'x' and temp > 2:
	ans += temp - 2
print(ans)


n = int(input())
s = input()
start = -1
c = 0
for i in range(n):
	if s[i] == 'x' and start == -1:
		start = i
	if s[i] != 'x' and start != -1:
		length = i - start + 1
		c += length - 3 if length - 2 > 0 else 0
		start = -1
if start != -1:
	c += n - start - 2 if (n - start - 2 > 0) > 0 else 0
print(c)


suma = 0
k = []
co = 0
input()
n = input()
for i in range(len(n)):
	if n[i] == 'x' and i != len(n) - 1:
		co += 1
	else:
		if i == len(n) - 1 and n[i] == 'x':
			co += 1
		if co > 2:
			k.append(co)
		co = 0
for i in range(len(k)):
	suma += k[i] - 2
print(suma)


tam = input()
frase = input()
qtd = 0
count_x = 0
for l in frase:
	if l == 'x':
		count_x += 1
	else:
		if count_x >= 3:
			qtd += -1 * (2 - count_x)
		count_x = 0
if count_x >= 3:
	qtd += -1 * (2 - count_x)
print(qtd)


n = int(input())
s = input()
i = 0
c = 0
ans = 0
while i < n:
	x = s[i]
	if x == 'x':
		c += 1
	else:
		if c > 2:
			ans += c - 2
		c = 0
	i += 1
ans += max(0, c - 2)
print(ans)


n = int(input())
s = input()
ans = 0
count = 0
for char in s:
	if char == 'x':
		count += 1
		if count >= 3:
			ans += 1
	else:
		count = 0
print(ans)


n = int(input())
L = list(input())
i = 0
j = 0
while i in range(n - 2):
	k = 0
	while L[i] == 'x':
		k += 1
		i += 1
		if i == n:
			break
	if k >= 3:
		j += k - 2
	i += 1
print(j)


def main():
	len_s = int(input())
	s = input()
	x_cnt = 0
	rm_cnt = 0
	for i in range(len_s):
		if s[i] == 'x':
			x_cnt += 1
		else:
			rm_cnt += max(0, x_cnt - 2)
			x_cnt = 0
	rm_cnt += max(0, x_cnt - 2)
	print(rm_cnt)
main()


n = int(input())
s = input()
ans = 0
while s.find('xxx') != -1:
	s = s[:s.find('xxx')] + s[s.find('xxx') + 1:]
	ans += 1
print(ans)


n = int(input())
s = input()
f = 0
for i in range(n - 2):
	if s[i:i + 3] == 3 * 'x':
		f += 1
print(f)


n = input()
str = input()
count = 0
while 'xxx' in str:
	str = str.replace('xxx', 'xx', 1)
	count += 1
else:
	print(count)


n = int(input())
s = str(input())
l = list(s)
count = 0
for i in range(2, len(l)):
	if l[i] == 'x' and l[i - 1] == 'x' and (l[i - 2] == 'x'):
		count += 1
print(count)


n = int(input())
a = input()
c1 = 0
c2 = 0
for i in a:
	if i == 'x':
		c1 += 1
	else:
		if c1 >= 2:
			c2 += c1 - 2
		c1 = 0
if a[-1] == 'x' and c1 >= 2:
	c2 += c1 - 2
print(c2)


n = int(input())
s = input()
(in_series, count) = (0, 0)
for i in s:
	if i == 'x':
		in_series += 1
		if in_series > 2:
			count += 1
	else:
		in_series = 0
print(count)


n = int(input())
s = input()
strtInd = s.find('xxx')
if strtInd == -1:
	print(0)
else:
	count = 0
	while strtInd != -1:
		count += 1
		strtInd = s.find('xxx', strtInd + 1)
	print(count)


n = int(input())
a = input()
s = 0
i = 0
while i < n:
	c = 0
	while a[i] == 'x':
		c = c + 1
		i = i + 1
		if i > n - 1:
			break
	if c > 2:
		s = s + (c - 2)
	i = i + 1
print(s)


n = int(input())
t = input()
t = t.lower()
l = list(t)
s = 0
c = 0
for i in l:
	if i == 'x':
		c += 1
	else:
		if c >= 3:
			s += c - 2
		c = 0
if c >= 3:
	s += c - 2
print(s)


n = int(input())
name = input()
xcount = 0
fdel = 0
for letter in name:
	if letter == 'x':
		xcount += 1
	elif letter != 'x':
		if xcount > 2:
			fdel += xcount - 2
		xcount = 0
if name[-1] == 'x' and xcount > 2:
	fdel += xcount - 2
print(fdel)


n = int(input())
word = input()
count = 0
for i in range(len(word) - 2):
	if word[i] == word[i + 1] == word[i + 2] == 'x':
		count += 1
print(count)


n = int(input())
filename = input()
res = 0
while 'xxx' in filename:
	indx = filename.index('xxx')
	filename = filename[:indx] + filename[indx + 1:]
	res += 1
print(res)


n = int(input())
m = input()
c = 0
for i in range(n):
	if m[i:i + 3] == 'xxx':
		c = c + 1
print(c)


n = int(input())
s = input()
c = 0
a = 0
for i in s:
	if i == 'x':
		c = c + 1
	else:
		c = 0
	if c >= 3:
		a += 1
print(a)


input()
file = input()
print(sum((file[i:].startswith('xxx') for i in range(len(file)))))


n = int(input())
s = input()
c = 0
for i in range(n):
	if s[i] == 'x':
		for j in range(i + 1, n):
			if s[j] == 'x':
				for k in range(j + 1, n):
					if s[k] == 'x':
						c += 1
					break
			break
print(c)


size = int(input())
string = input()
deleted = 0
counter = 1
for i in string:
	if i == 'x':
		if counter >= 3:
			deleted += 1
		else:
			counter += 1
	else:
		counter = 1
print(deleted)


n = int(input())
s = input()
count = 0
flag = 0
count = 0
countarr = []
for i in range(n):
	if flag == 1:
		if s[i] == 'x':
			count += 1
			if i == n - 1:
				countarr.append(count)
		else:
			countarr.append(count)
			count = 0
			flag = 0
	elif s[i] == 'x':
		flag = 1
		count += 1
		if i == n - 1:
			countarr.append(count)
	else:
		continue
ans = 0
for i in countarr:
	if i >= 2:
		ans += i - 2
print(ans)


length = input()
filename = input()
num = 0
while 'xxx' in filename:
	filename = filename.replace('xxx', 'xx', 1)
	num += 1
print(num)


n = int(input())
s = list(input())
c = 0
for i in range(n - 2):
	if s[i] == s[i + 1] == s[i + 2] == 'x':
		c += 1
print(c)


class Solution:

	def solve(self, string):
		numOfXs = 0
		toRemove = 0
		for ch in string:
			if ch == 'x':
				numOfXs += 1
			else:
				numOfXs = 0
			if numOfXs == 3:
				toRemove += 1
				numOfXs -= 1
		return toRemove
sol = Solution()
t = int(input().strip())
string = input().strip()
print(sol.solve(string))


input()
(r, c) = (0, 0)
for i in input() + '0':
	if i == 'x':
		c = c + 1
	else:
		if c >= 3:
			r = r + c - 2
		c = 0
print(r)


def remove(n, name):
	count = 0
	while 'xxx' in name:
		name = name.replace('xxx', 'xx', 1)
		count += 1
	print(count)

def fileName(n, name):
	if 'xxx' not in name:
		print(0)
	elif 'xxx' in name:
		remove(n, name)
n = input()
name = input()
fileName(n, name)


input()
(r, a) = (0, input())
while a.count('xxx'):
	a = a.replace('xxx', 'xx', 1)
	r += 1
print(r)


input()
fileName = input()
counter = 0
counterX = 0
for i in fileName:
	if i == 'x':
		counter += 1
	else:
		counter = 0
	if counter >= 3:
		counterX += 1
print(counterX)


def go():
	n = int(input())
	s = input()
	x_sequences = []
	i = 0
	while i < n:
		if s[i] == 'x':
			j = i
			count = 0
			while j < n and s[j] == 'x':
				count += 1
				j += 1
			i = j
			if count >= 3:
				x_sequences.append(count)
		else:
			i += 1
	if len(x_sequences) == 0:
		return 0
	return sum(x_sequences) - 2 * len(x_sequences)
print(go())


n = input()
s = input()
(count, ans) = (0, 0)
for i in s:
	if i == 'x':
		count += 1
	else:
		if count > 2:
			ans += count - 2
		count = 0
if count > 2:
	ans += count - 2
print(ans)


n = int(input())
st = input()
count = 0
i = 0
while i < n - 1:
	if st[i] + st[i + 1] == 'xx':
		i = i + 2
		while i < n and st[i] == 'x':
			count = count + 1
			i = i + 1
	else:
		i = i + 1
print(count)


n = int(input())
s = str(input())
s = s + 's'
is_x = False
counter = 0
almost_ans = []
for i in range(n + 1):
	if s[i] == 'x':
		is_x = True
	else:
		is_x = False
	if is_x:
		counter += 1
	else:
		almost_ans.append(counter)
		counter = 0
suma = 0
for x in almost_ans:
	if x > 2:
		suma += x - 2
print(suma)


from sys import stdin, stdout
import math
N = int(input())
s = input()
cur = ''
L = 0
res = 0
for letter in s:
	if letter == cur and letter == 'x':
		L += 1
	elif letter == 'x':
		L = 1
	else:
		L = 0
	if L >= 3:
		res += 1
	cur = letter
print(res)


n = int(input())
s = input()[:n]
cnt = 0
sum = 0
maxi = 1
for i in range(n):
	if s[i] == 'x':
		cnt += 1
	if s[i] != 'x':
		if cnt >= 3:
			for i in range(101):
				if cnt - i == 2:
					sum += i
					cnt = 0
					break
		else:
			cnt = 0
maxi = max(maxi, cnt)
if maxi >= 3:
	for i in range(n):
		if maxi - i == 2:
			print(sum + i)
			break
elif sum > 0:
	print(sum)
else:
	print(0)


n = int(input())
s = input()
count = 0
for i in range(2, n):
	if i == n:
		break
	if s[i - 2] == 'x' and s[i - 1] == 'x' and (s[i] == 'x'):
		count += 1
print(count)


from math import log
n = int(input())
s = input()
ans = 0
for i in range(2, n):
	if s[i] == 'x' and s[i - 1] == 'x' and (s[i - 2] == 'x'):
		ans += 1
print(ans)


GI = lambda : int(input())
GIS = lambda : map(int, input().split())
LGIS = lambda : list(GIS())

def main():
	n = GI()
	s = input()
	xseen = 0
	seqs = []
	for (i, c) in enumerate(s):
		if c == 'x':
			xseen += 1
		if c != 'x' or i == n - 1:
			if xseen >= 3:
				seqs.append(xseen)
			xseen = 0
	to_remove = 0
	for a in seqs:
		to_remove += a - 2
	print(to_remove)
main()


class Solution:

	def minus(self, s):
		m = 0
		i = 0
		while i < len(s) - 2:
			if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
				m = m + 1
			else:
				m = m
			i = i + 1
		return m
t = Solution()
b = input()
a = input()
print(t.minus(a))


import sys
n = int(sys.stdin.readline().strip())
line = sys.stdin.readline().strip()
res = 0
x_count = 0
for char in line:
	if char == 'x':
		x_count += 1
		if x_count > 2:
			res += 1
	else:
		x_count = 0
print(res)


n = int(input())
a = input()
summ = 0
i = 0
counter = 0
while i < n:
	counter = 0
	while a[i] == 'x':
		counter += 1
		if i == n - 1:
			break
		i += 1
	if counter > 2:
		summ += counter - 2
	i += 1
print(summ)


input()
ans = 0
s = input()
t = 0
for i in s:
	if i == 'x':
		t += 1
	elif t > 2:
		ans += t - 2
		t = 0
	else:
		t = 0
if t > 2:
	ans += t - 2
print(ans)


from sys import stdin, stdout
import random
import time

def fileName(arr, n):
	delete = 0
	for i in range(n - 2):
		if arr[i] == 'x' and arr[i + 1] == 'x' and (arr[i + 2] == 'x'):
			delete += 1
	return delete
n = int(input())
arr = [x for x in input()]
print(fileName(arr, n))

def removeDup(arr):
	new = []
	seen = []
	for i in range(len(arr) - 1, -1, -1):
		if arr[i] not in seen:
			seen.append(arr[i])
			new.append(arr[i])
	new = new[::-1]
	return (len(new), new)

def threepal(n):
	s = [0 for x in range(n)]
	all_choices = ['a', 'b', 'c']
	preferred_choices = ['a', 'b']
	if n == 0:
		return ''
	if n == 1:
		return random.choice(preferred_choices)
	for i in range(2):
		s[i] = random.choice(preferred_choices)
	for i in range(2, int(n / 1)):
		if s[i - 2] == 'a':
			s[i] = 'b'
		else:
			s[i] = 'a'
	return ''.join(s)

def decrypt(t, n):
	for i in range(2, n):
		if n % i == 0:
			t = t[i - 1::-1] + t[i:]
	t = t[::-1]
	return t

def beautifulString(s):
	letters = set(('a', 'b', 'c'))
	for i in range(len(s)):
		if i < len(s) - 1:
			if s[i] != '?' and s[i] == s[i + 1]:
				return -1
		if s[i] == '?':
			usedLetters = set()
			if i < len(s) - 1:
				usedLetters.add(s[i + 1])
			if i > 0:
				usedLetters.add(s[i - 1])
			remaining = list(letters - usedLetters)
			new_character = random.choice(remaining)
			s[i] = new_character
	return ''.join(s)


n = int(input())
str = input()[:n]
cnt = 0
for i in range(len(str) - 2):
	if str[i:i + 3] == 'xxx':
		cnt += 1
print(cnt)


n = int(input())
arr = list(input())
to_count = False
count = 0
removed = 0
for x in arr:
	if x == 'x':
		count += 1
		to_count = True
	elif to_count:
		to_count = False
		removed += max(count - 2, 0)
		count = 0
if to_count:
	to_count = False
	removed += max(count - 2, 0)
	count = 0
print(removed)


n = int(input())
string = input()
count = 0
if 'xxx' in string:
	while 'xxx' in string:
		pos = string.find('xxx')
		string = string[:pos] + string[pos + 1:]
		count = count + 1
print(count)


a = input()
a = input()
b = a.find('xxx')

def kill_char(string, n):
	begin = string[:n]
	end = string[n + 1:]
	return begin + end
count = 0
while b != -1:
	a = kill_char(a, b)
	b = a.find('xxx')
	count += 1
print(count)


n = int(input())
s = input()
x = 0
ans = 0
for i in range(n):
	if s[i] == 'x':
		x += 1
		if x > 2:
			ans += 1
	else:
		x = 0
print(ans)


import sys
mylength = int(sys.stdin.readline())
myline = sys.stdin.readline()
myline = myline + '$'
ind = 0
countx = 0
tmp = ''
result = 0
while ind <= mylength:
	if countx == 0 and myline[ind] == 'x':
		countx += 1
		tmp = myline[ind]
	elif countx > 0 and myline[ind] == 'x' and (tmp == 'x'):
		countx += 1
		tmp = myline[ind]
	if myline[ind] != 'x' and tmp == 'x':
		if countx >= 3:
			result += countx - 2
		tmp = myline[ind]
		countx = 0
	ind += 1
sys.stdout.write(str(result))


n = int(input())
a = str(input())
r = 0
for i in range(3, n + 1):
	if a[i - 3:i] == 'xxx':
		r += 1
print(r)


n = int(input())
line = input()
count = 0
while 'xxx' in line:
	index_xxx = line.find('xxx')
	if index_xxx == 0:
		line = line[1:]
		count += 1
	elif index_xxx >= 1:
		line = f'{line[:index_xxx]}{line[index_xxx + 1:]}'
		count += 1
	else:
		pass
print(count)


def solve(string):
	consecutive_x = list()
	current = 0
	for (i, c) in enumerate(string):
		if c == 'x':
			if current == 0:
				current += 1
			elif string[i - 1] == 'x':
				current += 1
		elif current > 0:
			if string[i - 1] == 'x':
				consecutive_x.append(current)
				current = 0
	if current > 0:
		consecutive_x.append(current)
	return sum([x - 2 for x in consecutive_x if x > 2])

def main():
	n = int(input())
	string = input()
	print(solve(string))
main()


n = int(input())
l = list(input())
z = []
count = 1
sum = 0
for i in range(n - 1):
	if l[i] == 'x' and l[i + 1] == 'x':
		count += 1
	else:
		if count >= 3:
			sum += count - 2
		count = 1
if count >= 3:
	sum += count - 2
print(sum)


n = int(input())
a = input()
c = 0
for i in range(len(a) - 2):
	if a[i] == 'x' and a[i + 1] == 'x' and (a[i + 2] == 'x'):
		c += 1
print(c)


from sys import stdin

def main():
	(n,) = stdin_get_ints_from_line()
	s = stdin_get_string_from_line()
	res = 0
	for i in range(2, len(s)):
		if s[i] == 'x' and s[i - 1] == 'x' and (s[i - 2] == 'x'):
			res += 1
	print(res)
	return

def stdin_get_ints_from_line():
	return (int(x) for x in stdin.readline().strip().split(' '))

def stdin_get_ints_list_from_line():
	return list((int(x) for x in stdin.readline().strip().split(' ')))

def stdin_get_string_from_line():
	return stdin.readline().strip()
main()


n = int(input())
s = input()
x = s.count('xxx')
l = []
i = 0
while i < n:
	if s[i] == 'x':
		count = 1
		if i >= n - 2:
			break
		j = i + 1
		while s[j] == 'x':
			count += 1
			j += 1
			if j == n:
				break
		if count >= 3:
			l.append(count)
		i = j
	i += 1
ans = 0
if len(l) == 0:
	print(ans)
else:
	for i in l:
		ans += i - 2
	print(ans)


a = int(input())
b = list(input())
sum = 0
t = []
for i in range(len(b)):
	if b[i] == 'x':
		if i < len(b) - 1:
			t.append(b[i])
			continue
		else:
			t.append(b[i])
			if len(t) > 2:
				sum += len(t) - 2
				t.clear()
				continue
			else:
				t.clear()
				continue
	elif len(t) > 2:
		sum += len(t) - 2
		t.clear()
		continue
	else:
		t.clear()
		continue
print(sum)


d = int(input())
s = input()
j = 0
for i in range(0, len(s) - 2):
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		j += 1
print(j)


n = int(input())
input = input()
output = 0
x = 0
for i in range(n):
	if input[i] == 'x':
		x += 1
	else:
		output += max(0, x - 2)
		x = 0
output += max(0, x - 2)
print(output)


input()
inp = input()
num = int()
for x in range(2, len(inp)):
	if inp[x] == inp[x - 1] == inp[x - 2] == 'x':
		num = num + 1
print(num)


def solution(s, n):
	no_x = 0
	i = 0
	while i < n:
		if s[i] == 'x':
			if i + 1 < n and s[i + 1] == 'x':
				if i + 2 < n and s[i + 2] == 'x':
					no_x += 1
		i += 1
	print(no_x)
n = int(input())
s = input()
solution(s, n)


n = int(input())
line = input()
counter = 0
while 'xxx' in line:
	cur = list(line)
	cur.pop(line.index('xxx'))
	line = ''.join(cur)
	counter += 1
print(counter)


n = int(input())
string = input()
count = [0] * n
for i in range(n):
	if string[i] == 'x':
		count[i] += 1
cnt = 1
c = 0
for j in range(1, n):
	if count[j] == count[j - 1] == 1:
		cnt += 1
	else:
		c = c + max(0, cnt - 2)
		cnt = 1
c = c + max(0, cnt - 2)
print(c)


n = int(input())
file_name = input()
cnt = 0
while file_name.find('xxx') != -1:
	pos = file_name.find('xxx')
	file_name = file_name[:pos] + file_name[pos + 1:]
	cnt += 1
print(cnt)


n = int(input())
s = input()
cnt = 0
res = 0
for i in range(n):
	if s[i] != 'x':
		cnt = 0
	elif s[i] == 'x' and cnt < 2:
		cnt += 1
	elif s[i] == 'x' and cnt >= 2:
		res += 1
print(res)


n = int(input())
the_string = input()
count = 0
for i in range(0, n - 2):
	if the_string[i] + the_string[i + 1] + the_string[i + 2] == 'xxx':
		count += 1
print(count)


n = int(input())
s = input()
file_name = list(s)
i = 0
qtd = 0
while i <= n - 3:
	if file_name[i] == 'x' and file_name[i + 1] == 'x' and (file_name[i + 2] == 'x'):
		qtd = qtd + 1
	i = i + 1
print(qtd)


n = int(input())
s = input()
x = 0
a = []
while x < n:
	if s[x] == 'x':
		s1 = []
		while x < n and s[x] == 'x':
			s1.append('x')
			x += 1
		a.append(s1)
	else:
		x += 1
ans = 0
for i in range(len(a)):
	if len(a[i]) > 2:
		ans += len(a[i]) - 2
print(ans)


n = int(input())
s = input()
c = 0
for i in range(0, len(s) - 2):
	if s[i:i + 3] == 'xxx':
		c = c + 1
print(c)


input()
arr = []
count = 0
res = 0
data = input()
for i in data:
	if i == 'x':
		count += 1
	else:
		arr.append(count)
		count = 0
arr.append(count)
for i in list(filter(lambda x: x, arr)):
	if i >= 3:
		res += i - 2
print(res)


i = input()
s = input()
x = 0
r = 0
for i in s:
	if i != 'x':
		if x != 0:
			x = 0
		continue
	elif x >= 2:
		r += 1
	else:
		x += 1
print(r)


length = int(input())
filename = input()
remove = 0
for i in range(length - 2):
	if filename[i] + filename[i + 1] + filename[i + 2] == 'xxx':
		remove += 1
print(remove)


def chk(s):
	n = len(s)
	for i in range(n - 2):
		if s[i] == 'x' == s[i + 1] == s[i + 2]:
			return i
	return 0
n = int(input())
a = input()
if n == a.count('x'):
	print(n - 2)
elif 'xxx' not in a:
	print(0)
else:
	c = 0
	while 'xxx' in a:
		i = chk(a)
		a = a[:i] + a[i + 1:]
		c += 1
	print(c)


n = int(input())
str = input()
str2 = str
while str.count('xxx'):
	str = str.replace('xxx', 'xx')
print(len(str2) - len(str))


n = int(input())
s = input()
f = 0
c = 0
sum = 0
for i in range(n):
	if s[i] == 'x':
		c = c + 1
		sum = c
	else:
		if sum >= 3:
			f = f + (c - 2)
		c = 0
		sum = 0
if sum >= 3:
	f = f + (c - 2)
if f != 0:
	print(f)
else:
	print(0)


n = int(input())
string = input() + ' '
xs_in_a_row = 0
x_counts = []
for i in range(n + 1):
	if string[i] == 'x':
		xs_in_a_row += 1
	else:
		x_counts.append(xs_in_a_row)
		xs_in_a_row = 0
min_num_of_chars = 0
for count in x_counts:
	if count >= 3:
		min_num_of_chars += count - 2
print(min_num_of_chars)


n = int(input())
s = input()
c = 0
for i in s:
	if i != 'x':
		s = s.replace(i, ' ')
a = s.split()
for i in a:
	if len(i) >= 3:
		c += len(i) - 2
print(c)


n = int(input())
s = input()
unicount = 0
a = s.find('xxx')
while a != -1:
	count = 0
	for i in s[a:]:
		if i != 'x':
			break
		else:
			count += 1
	s = s[0:a + 2] + s[a + count:]
	a = s.find('xxx')
	unicount += count - 2
print(unicount)


n = int(input())
s = input()
ans = 0
for i in range(0, len(s) - 2):
	if len(set(s[i:i + 3])) == 1 and s[i] == 'x':
		ans += 1
print(ans)


n = int(input())
s = input()
k = 0
while 'xxx' in s:
	k += 1
	i = s.find('xxx')
	s = s[:i] + s[i + 1:]
print(k)


(n, s, c, d) = (int(input()), input(), 0, 0)
for i in range(0, n, 1):
	if s[i] == 'x':
		c = c + 1
	else:
		c = 0
	if c == 3:
		d = d + 1
		c = c - 1
print(d)


n = int(input())
s = list(input())
t = 0
c = 0
for i in range(n):
	if s[i] == 'x':
		t += 1
		if i == n - 1 and t >= 3:
			c = c + t - 2
	elif s[i] != 'x':
		if t >= 3:
			c = c + t - 2
		t = 0
print(c)


def rahul(word):
	return [char for char in word]
input()
a = rahul(input())
r = 0
(b, c, d) = (0, 0, 0)
while r < len(a):
	b = c
	if a[r] == 'x':
		c = c + 1
	if c == b and c > 2:
		d = d + (c - 2)
		c = 0
	if c > 2 and r == len(a) - 1:
		d = d + (c - 2)
	if c == b and c < 3:
		c = 0
	r = r + 1
print(d)


string_length = int(input())
input_string = list(input())
letters_to_remove = 0
idx_i = 0
idx_j = 2
while idx_i < string_length:
	current_substring = ''.join(input_string[idx_i:idx_j + 1])
	if current_substring == 'xxx':
		letters_to_remove += 1
	idx_i += 1
	idx_j += 1
print(letters_to_remove)


n = int(input())
s = list(input())
new = []
x = 0
for i in range(n):
	if s[i] == 'x' and x < 2:
		new.append(s[i])
		x += 1
	elif s[i] != 'x':
		new.append(s[i])
		x = 0
print(len(s) - len(new))


n = int(input())
s = input()
c = 0
xxx = s.find('xxx')
while xxx != -1:
	c = c + 1
	l = list(s)
	l[xxx] = ''
	s = ''.join(l)
	xxx = s.find('xxx')
print(c)


n = int(input())
x = str(input())
c = 0
r = 0
for i in range(n):
	if x[i] == 'x' and c != 2:
		c += 1
	elif c == 2 and x[i] == 'x':
		r += 1
	else:
		c = 0
print(r)


n = int(input())
cnt = 0
ans = 0
for i in input():
	if i != 'x':
		ans += max(cnt - 2, 0)
		cnt = 0
	else:
		cnt += 1
ans += max(cnt - 2, 0)
print(ans)


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : [int(i) for i in inp().split()]
li0 = lambda x: [0 for i in range(x)]
stent = lambda : [i for i in inp()]
n = iinp()
linea = stent()
juntas = 0
res = 0
for i in linea:
	if i == 'x':
		juntas += 1
	else:
		if juntas >= 3:
			res += abs(2 - juntas)
		juntas = 0
if juntas >= 3:
	res += abs(2 - juntas)
print(res)


n = int(input())
x = list(input())
s = 0
r = 0
for i in range(n - 2):
	if x[i] == x[i + 1] and x[i] == x[i + 2] and (x[i] == 'x'):
		s = 1
		if s == 1:
			r += 1
	s = 0
print(r)


(n, t) = (int(input()), input())
cnt = 0
for i in range(n - 2):
	if t[i:i + 3] == 'xxx':
		cnt += 1
print(cnt)


n = int(input())
s = input()
s = s + 'i'
co = 0
po = 0
for i in range(n):
	if s[i] == s[i + 1] and s[i] == 'x':
		co += 1
	else:
		if co >= 2:
			po += co - 1
		co = 0
print(po)


n = int(input())
s = input().rstrip()
x = list(s)
i = 0
M = 0
while i < len(x) - 1:
	if x[i] == 'x' and x[i + 1] == 'x' and (M == 0):
		i += 1
		M = 1
	elif x[i] == 'x' and x[i + 1] == 'x' and (M == 1):
		del x[i]
	else:
		i += 1
		M = 0
print(len(s) - len(x))


n = int(input())
a = input()
count = 0
for i in range(n - 2):
	if a[i:i + 3] == 'xxx':
		count += 1
print(count)


length = int(input())
s = input()
count = 0
temp = ''
for i in range(length):
	if s[i] == 'x':
		temp += 'x'
	else:
		count += max(len(temp) - 2, 0)
		temp = ''
count += max(len(temp) - 2, 0)
print(count)


n = int(input())
s = input()
if 'xxx' in s == False:
	print(0)
else:
	cnt = 0
	while 'xxx' in s:
		i = s.index('xxx')
		s = s[0:i] + s[i + 1:len(s)]
		cnt += 1
	print(cnt)


n = int(input())
k = input()
co = 0
for i in range(n - 2):
	if k[i] == 'x' and k[i + 1] == 'x' and (k[i + 2] == 'x'):
		co += 1
print(co)


n = int(input())
A = input()
tot = 0
curr = 0
for i in A:
	if i == 'x' and curr == 2:
		tot += 1
	elif i == 'x':
		curr += 1
	else:
		curr = 0
print(tot)


(n, strings) = (int(input()), input())
print(sum((1 for (i, si) in enumerate(strings) if strings[i:i + 3] == 'xxx')))


n = int(input())
s = input()
count = 0
b = []
for i in range(len(s)):
	if s[i] == 'x':
		count = count + 1
		if i == len(s) - 1:
			b.append(count)
	else:
		b.append(count)
		count = 0
for i in range(len(b)):
	if b[i] == 0 or b[i] == 1:
		b[i] = 0
	else:
		b[i] = b[i] - 2
print(sum(b))


n = int(input())
letters = [char for char in input()]
count = 0
prev1 = letters[0]
prev2 = letters[1]
for l in letters[2:]:
	if l == 'x' and prev1 == 'x' and (prev2 == 'x'):
		count += 1
	prev1 = prev2
	prev2 = l
print(count)


def main():
	n = int(input())
	rem = 0
	s = input()
	findXXX = s.find('xxx')
	while findXXX != -1:
		pivot = findXXX + 2
		if pivot != n:
			s = s[:pivot] + '' + s[pivot + 1:]
		else:
			s = s[:pivot] + ''
		n -= 1
		rem += 1
		findXXX = s.find('xxx')
	print(rem)
main()


a = int(input())
b = input()
count = 0
while b.find('xxx') != -1:
	if b.find('xxx') + 3 < a:
		b = b[:b.find('xxx') + 2] + b[b.find('xxx') + 3:]
		count = count + 1
	else:
		b = b[:b.find('xxx') + 2]
		count = count + 1
print(count)


n = int(input())
s = input()
s1 = s
if s.count('xxx') == 0:
	print(0)
else:
	while s1.count('xxx') != 0:
		s1 = s1.replace('xxx', 'xx')
	print(len(s) - len(s1))


n = int(input())
x = input()
ans = 0
for i in range(2, n):
	if x[i - 2:i + 1] == 'xxx':
		ans += 1
print(ans)


n = int(input())
a = input()
cnt = 0
i = 0
while i < n:
	if a[i] == 'x' and i < n - 2:
		i += 1
		if a[i] == 'x' and i < n - 1:
			i += 1
			while i < n and a[i] == 'x':
				cnt += 1
				i += 1
	if i == n - 1:
		break
	else:
		i += 1
print(cnt)


def CountOccurrences(string, substring):
	count = 0
	start = 0
	while start < len(string):
		pos = string.find(substring, start)
		if pos != -1:
			start = pos + 1
			count += 1
		else:
			break
	return count
n = int(input())
s = input()
t = CountOccurrences(s, 'xxx')
print(t)


n = int(input())
s = input()
(c, l) = (0, 0)
for v in s:
	if v == 'x':
		l += 1
	else:
		l = 0
	if l > 2:
		c += 1
print(c)


import re

def checkFile(s):
	ans = re.findall('x{3,}', s)
	val = 0
	if not ans:
		return 0
	for string in ans:
		val = val + len(string) - 2
	return val
size = int(input())
s = input().strip()
print(checkFile(s))


a = int(input())
l = input()
ans = 0
total = 0
for i in range(a):
	try:
		if l[i] == 'x' and l[i] == l[i + 1]:
			total += 1
		else:
			if total >= 2:
				ans += total - 1
			total = 0
	except:
		if total >= 2:
			ans += total - 1
print(ans)


from itertools import groupby
n = int(input())
s = input()
c = s.count('xxx')
ans = 0
if c > 0:
	s = list(s)
	for (i, j) in groupby(s):
		if i == 'x':
			l = list(j)
			if len(l) >= 3:
				ans += len(l) - 2
	print(ans)
else:
	print(c)


import re
first = input()
st = input().strip('\n')
d = re.findall('x+', st)
count = 0
for i in d:
	if len(i) <= 2:
		pass
	else:
		count += len(i) - 2
print(count)


import sys

def readint():
	return int(sys.stdin.readline().strip())

def readints():
	return list(map(int, sys.stdin.readline().strip().split()))
n = readint()
s = sys.stdin.readline().strip()
ans = 0
while True:
	s0 = s.replace('xxx', 'xx', 1)
	if s0 == s:
		break
	s = s0
	ans += 1
print(ans)


n = int(input())
d = 0
x = 0
for i in input():
	if i == 'x':
		x += 1
		if x > 2:
			d += 1
	else:
		x = 0
print(d)


def main():
	import sys
	n = int(sys.stdin.readline())
	st = sys.stdin.readline()
	ans = 0
	s_idx = 0
	sub = 'xxx'
	while st.find(sub, s_idx, len(st)) != -1:
		ans += 1
		s_idx = st.find(sub, s_idx, len(st)) + 1
	print(ans)
main()


n = int(input())
s = input()
c = 0
while s.find('xxx') != -1:
	f = s.find('xxx')
	s = s[:f] + s[f + 1:]
	c += 1
print(c)


length = int(input())
a = input()
count = 0
if len(a) == length:
	for i in range(len(a) - 2):
		if a[i] == 'x' and a[i + 1] == 'x' and (a[i + 2] == 'x'):
			count += 1
	print(count)


b = input()
a = input()
c = cnt = 0
for i in range(len(a)):
	if a[i] == 'x':
		c += 1
	elif c > 2:
		cnt = cnt + c - 2
		c = 0
	else:
		c = 0
if c > 2:
	cnt = cnt + c - 2
print(cnt)


n = int(input())
A = input()
count = 0
for val in range(n - 3 + 1):
	if A[val:val + 3] == 'xxx':
		count += 1
print(count)


input()
s = input().strip() + ' '
(r, c) = (0, 0)
for i in s:
	if i == 'x':
		c += 1
	else:
		r += c - 2 if c > 2 else 0
		c = 0
print(r)


n = int(input())
a = input()
c = 0
for i in range(n - 2):
	if a[i] + a[i + 1] + a[i + 2] == 'xxx':
		c += 1
print(c)


n = int(input())
s = input()
if 'xxx' not in s:
	print('0')
else:
	count = 0
	ini = 0
	f = 0
	for i in range(n):
		if s[i] == 'x':
			f = 0
			count += 1
		else:
			f = 1
			if count >= 3:
				ini += count - 2
			count = 0
	if f == 0 and count >= 3:
		ini += count - 2
	print(ini)


def answer():
	n = int(input())
	a = list(input())
	ans = 0
	while True:
		i = 0
		scoot = 0
		while i < len(a) - 2:
			if a[i] + a[i + 1] + a[i + 2] == 'xxx':
				d = a[:i]
				e = a[i + 1:]
				a = []
				for x in d:
					a.append(x)
				for x in e:
					a.append(x)
				scoot = 1
				ans += 1
				break
			i += 1
		if not scoot:
			break
	return ans
print(answer())


import re
n = int(input())
s = input()
ans = 0
for occ in re.split('[^x]+', s):
	ans += max(0, len(occ) - 2)
print(ans)


n = int(input())
l = str(input())
i = 0
c = 0
while i < n - 2:
	if l[i:i + 3] == 'xxx':
		c += 1
		j = i + 3
		while j < n and l[j] == 'x':
			c += 1
			j += 1
		i = j
	else:
		i += 1
print(c)


n = int(input())
a = input()
k = 0
ans = 0
for i in range(n):
	if a[i] == 'x':
		k += 1
	else:
		if k > 2:
			ans += k - 2
		k = 0
if k > 2:
	ans += k - 2
print(ans)


n = int(input())
input = input()
conseq = 0
total = 0
toRemove = []
changed = True
removedCount = 0
while changed:
	changed = False
	for i in range(0, n):
		if input[i] == 'x':
			conseq += 1
			if conseq % 3 == 0 and conseq > 0:
				toRemove.append(i)
				changed = True
		if input[i] != 'x' or i == n - 1:
			if conseq > 0:
				conseq = 0
	if changed:
		for i in toRemove[::-1]:
			input = input[:i - 1] + input[i:]
			n -= 1
			total += 1
	toRemove = []
print(total)


n = int(input())
s = input()
maxlen = 0
curlen = 0
state = 'x'
for c in s:
	if state == 'x' and c != 'x':
		maxlen += max(0, curlen - 2)
		curlen = 0
	elif c == 'x':
		curlen += 1
	state = c
if state == 'x':
	maxlen += max(0, curlen - 2)
print(maxlen)


length = int(input())
string = str(input())

def solution(string):
	is_x = False
	to_delete = 0
	count_x = 0
	for lit in string:
		if lit == 'x':
			is_x = True
			count_x += 1
			if count_x > 2:
				to_delete += 1
		else:
			count_x = 0
			is_x = False
	return to_delete
print(solution(string))


_ = input()
name = list(input())
list_occ = 0
whole = 0
for i in range(len(name)):
	if name[i] == 'x':
		list_occ += 1
	if name[i] != 'x' or i == len(name) - 1:
		if list_occ > 2:
			whole += list_occ - 2
		list_occ = 0
print(whole)


n = int(input())
s = input()
v = 0
value = 0
for i in s:
	if i != 'x':
		if v > 2:
			value += v - 2
		v = 0
	else:
		v += 1
if v > 2:
	value += v - 2
print(value)


n = int(input())
s = input()
c = 0
count = 0
i = 0
while i < n:
	while i != n and s[i] == 'x':
		c += 1
		i += 1
	if c > 2:
		count += c - 2
	c = 0
	i += 1
print(count)


n = int(input())
s = input()[:n]
v = len(s)
if s.count('xxx') > 0:
	while s.count('xxx') > 0:
		p1 = s.index('xxx')
		s = s[:p1] + s[p1 + 1:]
	print(v - len(s))
else:
	print(0)


i = input
i()
s = i()
c = 0
i = 0
j = 3
while j < len(s) + 1:
	if s[i:j] == 'xxx':
		c += 1
	i += 1
	j += 1
print(c)


n = input()
s = input()
l = s[:2]
for (i, c) in enumerate(s[2:]):
	if c != 'x':
		l += c
	elif l[-1] != 'x' or l[-2] != 'x':
		l += c
print(len(s) - len(l))


n = int(input())
s = input()
m = 0
while s.count('xxx') != 0:
	s = s.replace('xxx', 'xx', 1)
	m += 1
print(m)


n = int(input())
s = input()
c = 0
while 1:
	if 'xxx' not in s:
		break
	else:
		i = s.index('xxx')
		s = s[:i] + s[i + 1:]
		c = c + 1
print(c)


n = int(input())
s = input().strip()
ans = 0
count = 0
flag = 0
for i in range(n):
	if flag == 0:
		if s[i] == 'x':
			count += 1
			flag = 1
	elif s[i] == 'x':
		count += 1
	else:
		if count >= 3:
			ans += count - 2
		count = 0
		flag = 0
if flag == 1:
	if count >= 3:
		ans += count - 2
print(ans)


def checxxx(s, start):
	if start > len(s):
		return False
	for i in range(start, start + 3):
		if s[i] != 'x':
			return False
	return True
n = int(input())
s = input()
ans = 0
for ci in range(len(s) - 2):
	if s[ci] == 'x':
		if checxxx(s, ci):
			ans += 1
print(ans)


n = int(input())
s = str(input())
if n < 3:
	print(0)
else:
	i = 0
	k = 0
	while i < len(s) - 3:
		if s[i:i + 3] == 'xxx':
			k += 1
		i += 1
	if s[i:] == 'xxx':
		k += 1
	print(k)


from sys import stdin, stdout

def rint():
	return map(int, stdin.readline().split())
n = int(input())
s = input()
cnt = 0
for i in range(n):
	if s[i:i + 3] == 'xxx':
		cnt += 1
print(cnt)


import re
input()
print(sum((len(x) - 2 for x in re.split('[^x]+', input()) if len(x) >= 3)))


n = int(input())
s = input()
t = 0
while 'xxx' in s:
	s = s.replace('xxx', 'xx', 1)
	t = t + 1
print(t)


from collections import Counter
n = int(input())
s = input()
print(Counter([s[i:i + 3] for i in range(n)])['xxx'])


n = int(input())
s = input()
cnt = 0
while 'xxx' in s:
	k = s.index('xxx')
	s = s[0:k] + s[k + 1:]
	cnt += 1
print(cnt)


import sys
import bisect
import math as mt
t = 1
mod = 10 ** 9 + 7
for _ in range(t):
	n = int(input())
	s = input()
	cnt = 0
	ans = 0
	for i in range(n):
		if s[i] == 'x':
			cnt += 1
		else:
			if cnt >= 3:
				ans += cnt - 2
			cnt = 0
	if cnt >= 3:
		ans += cnt - 2
	print(ans)


n = int(input())
file = input()
flag = 0
removes = 0
for i in range(n):
	if file[i] == 'x':
		if i <= n - 3:
			sub = file[i:i + 3]
			if sub == 'xxx':
				flag = 1
				removes += 1
print(removes)


n = int(input())
s = list(input())
(i, a, b) = (0, 2, 0)
while i <= n - 3:
	if s[i] == s[i + 1] == 'x':
		a = i + 2
		if s[a] == 'x':
			while s[a] == 'x':
				b += 1
				a += 1
				i = a
				if a == n:
					break
		else:
			i += 1
		if a == n:
			break
	else:
		i += 1
print(b)


import re

def main():
	n = int(input())
	print(n - len(re.sub('xxx+', 'xx', input())))
main()


n = int(input())
a = list(input()) + ['y']
ans = 0
pos = 0
while pos < n:
	if a[pos] == 'x':
		uk = pos + 1
		count = 1
		while uk < n and a[uk] == 'x':
			count += 1
			uk += 1
		ans += max(0, count - 2)
		pos = uk
	else:
		pos += 1
print(ans)


n = int(input())
str = input()
c = 0
for i in range(n - 2):
	if str[i:i + 3] == 'xxx':
		c += 1
print(c)


i = int(input())
c = input()
count = 0
j = 0
c = list(c)
for i in c:
	if i == 'x':
		j += 1
	else:
		j = 0
	if j > 2:
		count += 1
print(count)


def sucer(s):
	(i, res) = (0, 0)
	taille = len(s)
	while i < taille:
		(tmp, nbx) = (i, 0)
		while s[tmp] == 'x' and tmp < taille - 1:
			nbx += 1
			tmp += 1
		if s[tmp] == 'x':
			nbx += 1
		if nbx >= 3:
			res += nbx - 2
			i = tmp + 1
		else:
			i += 1
		nbx = 0
	return res
n = input()
s = input()
print(sucer(s))


n = input()
a = input()
s = 0
while a.count('xxx') != 0:
	a = a.replace('xxx', 'xx', 1)
	s += 1
print(s)


input('')
inp = input('')
delet = 0
while 'xxx' in inp:
	inp = inp.replace('xxx', 'xx', 1)
	delet = delet + 1
print(delet)


n = int(input())
name = input()
letters = n
foundX = False
count = 0
amount = 0
for letter in name:
	if letter == 'x':
		foundX = True
	if foundX:
		if letter != 'x':
			if count >= 3:
				amount += count - 2
			count = 0
			foundX = False
		else:
			count += 1
if count >= 3:
	amount += count - 2
print(amount)


n = int(input())
s = input()
ans = 0
i = 0
while i < len(s) - 2:
	if s[i:i + 3] == 'xxx':
		ans += 1
		s = s[:i] + 'xx' + s[i + 3:]
	else:
		i += 1
print(ans)


n = int(input())
a = list(input())
b = []
i = 0
while i < n - 2:
	if a[i] == 'x' and a[i + 1] == 'x' and (a[i + 2] == 'x'):
		co = 0
		for j in range(i, n):
			if a[j] == 'x':
				co += 1
			else:
				break
		b.append(co)
		i = j - 1
	i += 1
print(sum(b) - 2 * len(b))


n = int(input())
s = input()
ans = 0
while 'xxx' in s:
	idx = s.find('xxx')
	s = s[:idx] + s[idx + 1:]
	ans += 1
print(ans)


n = int(input())
a = input()
l = 1
s = 0
for i in range(n - 1):
	if a[i] == 'x' and a[i + 1] == 'x':
		l = l + 1
	elif l > 2:
		m = l - 2
		s = s + m
		l = 1
	else:
		l = 1
if l > 2:
	k = l - 2
	s = s + k
print(s)


n = input()
s = input()
c = 0
while True:
	index = s.find('xxx')
	if index == -1:
		break
	s = s[:index] + s[index + 1:]
	c += 1
print(c)


n = int(input())
s = input()
c = 0
while 'xxx' in s:
	i = s.find('xxx')
	if i == 0:
		s = s[1:]
	else:
		s = s[:i] + s[i + 1:]
	c += 1
print(c)


n = int(input())
s = input()
while True:
	i = s.find('xxx')
	if i == -1:
		break
	s = s[:i] + s[i + 1:]
print(n - len(s))


n = int(input())
s = list(input())
s.append('a')
fq = len(s) * [0]
for i in range(n):
	if s[i] == 'x':
		fq[i] = 1
		if i > 0:
			fq[i] += fq[i - 1]
r = 0
for i in range(n):
	if fq[i + 1] > fq[i]:
		continue
	if fq[i] > 2:
		r += fq[i] - 2
print(r)


res = 0
cur = 0
input()
for c in input() + '0':
	if c == 'x':
		cur += 1
	else:
		if cur >= 3:
			res += cur - 2
		cur = 0
print(res)


int(input())
lst = [j for j in input()]
count = 0
for i in range(len(lst) - 2):
	if lst[i] == lst[i + 1] == lst[i + 2] == 'x':
		count += 1
print(count)


N = int(input())
L1 = input()
ctr = 0
del1 = 0
for i in L1:
	if i == 'x':
		ctr += 1
	else:
		ctr = 0
	if ctr > 2:
		del1 += 1
print(del1)


n = int(input())
st = input()
t = 0
while 'xxx' in st:
	t += 1
	xx = st.find('xxx')
	st = st[:xx] + st[xx + 1:]
print(t)


def doit(string, pointer):
	if len(string) < 3 or pointer > len(string) - 3:
		return string
	if string[pointer] == 'x' and string[pointer + 1] == 'x' and (string[pointer + 2] == 'x'):
		return doit(string[1:], pointer)
	else:
		return doit(string, pointer + 1)
number_length = int(input())
number = input()
print(number_length - len(doit(number, 0)))


n = int(input())
s = input()
count = 0
while 'xxx' in s:
	count += 1
	x = s.index('xxx')
	s = s[:x + 1] + s[x + 2:]
print(count)


n = int(input())
a = list(input())
p = []
t = 0
for i in range(n):
	if a[i] == 'x':
		t += 1
	else:
		if t >= 3:
			p.append(t)
		t = 0
	if i == n - 1:
		if a[i] == 'x':
			if t >= 3:
				p.append(t)
k = 0
for i in p:
	k += i - 2
print(k)


n = int(input())
s = input()
num = 0
dup = 0
i = 0
while i < n:
	if s[i] == 'x':
		j = i + 1
		while j < n and s[j] == 'x':
			j += 1
		num += max(0, j - i - 2)
		i = j
	i += 1
print(num)


s = [input() for _ in range(2)][1]
m = list()
t = ''
for i in range(1, len(s) + 1):
	if s[i - 1] == 'x':
		t += s[i - 1]
	else:
		m.append(t)
		t = ''
m.append(t)
while True:
	ok = False
	for i in m:
		if len(i) < 3:
			m.remove(i)
			ok = True
	if not ok:
		break
print(sum([len(i) - 2 for i in m]))


n = int(input())
S = input()
ans = 0
cnt = 1
s = S + 'A'
for i in range(n):
	if s[i] == 'x' and s[i + 1] == 'x':
		cnt += 1
	else:
		if cnt >= 3:
			ans += cnt - 2
		cnt = 1
print(ans)


n = int(input())
s = input()
i = ans = 0
while i < n:
	if s[i] == 'x':
		j = i + 1
		count = 1
		while j < n and s[i] == s[j]:
			count += 1
			j += 1
		if count > 2:
			ans += count - 2
		i = j
	else:
		i += 1
print(ans)


n = int(input())
spisok = list(input())
check = True
answer = 0
while check:
	if n == 2:
		break
	for i in range(0, n - 2):
		if spisok[i] == spisok[i + 1] == spisok[i + 2] == 'x':
			spisok.pop(i + 2)
			answer += 1
			n -= 1
			break
		if i == n - 3:
			check = False
print(answer)


def main():
	n = int(input())
	y = [i for i in input()]
	ans = 0
	i = 0
	while i < n:
		counter = 0
		if y[i] == 'x':
			for j in range(i, n):
				if y[j] == 'x':
					counter += 1
				if y[j] != 'x':
					break
			if counter >= 3:
				ans += counter - 2
			i += counter
			continue
		i += 1
	print(ans)
main()


n = int(input())
n1 = input()
lst = []
s = n1[:n] + 'z'
k = 0
m = 0
n = 0
if s.count('x') == len(s):
	print(s.count('x') - 2)
else:
	for i in s:
		if i == 'x':
			k = k + 1
			continue
		lst.append(k)
		k = 0
	for j in lst:
		if j >= 2:
			z = j - 2
			m = m + z
	print(m)


import re

def solve(n, msg):
	p = re.compile('xxx*')
	repl = 'xx'
	neu = p.sub(repl, msg)
	return n - len(neu)
n = int(input())
msg = input()
print(solve(n, msg))


n = input()
s = input()
sum = 0
for i in range(len(s)):
	if s[i:i + 3] == 'xxx':
		sum = sum + 1
print(sum)


def solution():
	(n, st) = (input(), input())
	res = 0
	i = 3
	while i <= len(st):
		if st[i - 3:i] == 'xxx':
			res += 1
		i += 1
	print(res)
solution()


n = int(input())
s = input()
(ctr, count) = (0, 0)
for a in s:
	if a == 'x':
		count += 1
		if count >= 3:
			ctr += 1
	else:
		count = 0
print(ctr)


x = int(input())
count = 0
str = input()
for i in range(x):
	if str[i:i + 3] == 'xxx':
		count += 1
print(count)


n = int(input())
filename = input() + '|'
to_remove = 0
x = 0
for letter in filename:
	if letter == 'x':
		x += 1
	else:
		to_remove += max(0, x - 2)
		x = 0
print(to_remove)


n = int(input())
s = input()
res = 0
x_count = 0
for c in s:
	if c == 'x':
		x_count += 1
	else:
		x_count = 0
	if x_count > 2:
		res += 1
print(res)


tam = int(input())
string = input()
resposta = 0
atual = 0
while atual < tam - 2:
	if string[atual] == 'x':
		if string[atual + 1] == 'x':
			atual = atual + 2
			while atual < tam:
				if string[atual] == 'x':
					resposta = resposta + 1
					atual = atual + 1
				else:
					break
	atual = atual + 1
print(resposta)


def count_overlapping_substrings(haystack, needle):
	count = 0
	i = -1
	while True:
		i = haystack.find(needle, i + 1)
		if i == -1:
			return count
		count += 1
n = int(input())
s = input()
print(count_overlapping_substrings(s, 'xxx'))


k = 0
t = 0
a = int(input())
b = str(input())
b += ' '
for i in b:
	if i == 'x':
		k += 1
	elif k > 2:
		t += k - 2
		k = 0
	else:
		k = 0
print(t)


n = int(input())
s = input()
from re import *
l = findall('xxx+', s)
if len(l) == 0:
	print(0)
else:
	print(sum((len(i) - 2 for i in l)))


fn = input()
fn = input()
n = 0
while 'xxx' in fn:
	fn = fn[:fn.find('xxx')] + fn[fn.find('xxx') + 1:]
	n += 1
print(n)


n = int(input())
s = input()
s = list(s)
x = 0
z = 0
for i in s:
	if i == 'x':
		x += 1
	else:
		x = 0
	if x == 3:
		z += 1
		x -= 1
print(z)


def FileName(n, s):
	c = 0
	fin = 0
	i = 0
	while i < n:
		if s[i] == 'x':
			j = 0
			while i < n and s[i] == 'x':
				i = i + 1
				j = j + 1
			if j >= 3:
				k = 0
				while j >= 3:
					k = k + 1
					j = j - 1
				fin = fin + k
		else:
			i = i + 1
	return fin
x = int(input())
s = input()
print(FileName(x, s))


n = int(input())
s = input()
suma = ama = 0
for i in range(0, n):
	if s[i] == 'x':
		suma += 1
	else:
		ama = max(max(ama, suma + ama - 2), 0)
		suma = 0
ama = max(max(ama, suma + ama - 2), 0)
print(ama)


n = int(input())
s = input()
flag = True
c = 0
while flag:
	x = s.find('xxx')
	if x != -1:
		s = s[0:x] + s[x + 1:]
		c += 1
	else:
		flag = False
print(c)


n = int(input())
s = input()
if 'xxx' not in s:
	print(0)
else:
	c = 0
	for i in range(n - 2):
		if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
			c += 1
	print(c)


n = int(input())
count = 0
q = input()
q = q[:] + 'p'
ls = list()
for i in q:
	if i == 'x':
		count = count + 1
	else:
		ls.append(count)
		count = 0
l = list()
for i in ls:
	if i >= 3:
		l.append(i - 2)
if len(l) > 0:
	print(sum(l))
else:
	print(0)


m = int(input())
n = input()
l = []
for i in range(m - 2):
	l.append(n[i:i + 3])
print(l.count('xxx'))


n = int(input())
p = input()
count = 0
a = 0
for i in range(n):
	if p[i] == 'x':
		count += 1
	elif p[i] != 'x':
		if count > 2:
			a += count - 2
		count = 0
if count > 2:
	a += count - 2
print(a)


input()
s = input()
cnt = 0
while 'xxx' in s:
	s = s.replace('xxx', 'xx', 1)
	cnt += 1
print(cnt)


from itertools import groupby
n = int(input())
s = input()
a = [''.join(g) for (k, g) in groupby(s)]
r = 0
for i in a:
	if i.count('x') >= 3:
		r += i.count('x') - 2
print(r)


n = int(input())
string = input()
count = 0
cnt = 0
for i in string:
	if i == 'x' and cnt < 2:
		cnt += 1
	elif i == 'x' and cnt >= 2:
		count += 1
	else:
		cnt = 0
print(count)


n = int(input())
z = input()
count = 0
hasil = 0
for i in z:
	if i == 'x':
		count += 1
	else:
		if count > 2:
			hasil += count - 2
		count = 0
if count > 2:
	hasil += count - 2
print(hasil)


n = int(input())
s = str(input())
dum = []
ans = 0
if 'xxx' in s:
	for i in s:
		i = str(i)
		dum += i
	x = len(dum)
	n = 1
	while n != x - 1:
		if dum[n - 1] == 'x' and dum[n] == 'x' and (dum[n + 1] == 'x'):
			dum.pop(n)
			ans += 1
			x = len(dum)
			continue
		else:
			n += 1
			x = len(dum)
			continue
	print(ans)
else:
	print(0)


n = int(input())
s = input() + 'p'
curcount = 0
ans = 0
for i in range(n + 1):
	if s[i] == 'x':
		curcount += 1
	elif curcount > 0:
		ans += max(0, curcount - 2)
		curcount = 0
print(ans)


n = int(input())
word = input()
i = 0
seq = 0
count = 0
while i < n:
	if word[i] == 'x':
		seq = seq + 1
	else:
		if seq >= 3:
			count = count + seq - 2
		seq = 0
	i = i + 1
if seq >= 3:
	count = count + seq - 2
print(count)


n = int(input())
s = input()
if 'xxx' not in s:
	print(0)
else:
	ans = 0
	xc = 0
	for i in range(n):
		if s[i] == 'x':
			if xc < 2:
				xc += 1
			elif xc >= 2:
				ans += 1
		elif s[i] != 'x':
			xc = 0
	print(ans)


input()
seq = 0
ans = 0
for c in input():
	if c == 'x':
		seq += 1
	else:
		ans += max(seq - 2, 0)
		seq = 0
ans += max(seq - 2, 0)
print(ans)


n = int(input())
s = input()
t = []
c = 1
if len(s) == 1:
	print(0)
else:
	for i in range(1, n):
		if s[i - 1] == 'x' and s[i] == 'x':
			c += 1
		else:
			t.append(c)
			c = 1
		if i == n - 1:
			t.append(c)
	ans = 0
	for i in t:
		if i > 2:
			ans += abs(2 - i)
	print(ans)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
input()
string = input()
deleted = 0
curr = 0
for char in string:
	if char == 'x':
		curr += 1
	else:
		deleted += curr - 2 if curr > 2 else 0
		curr = 0
print(deleted)


n = int(input())
l = list(input())
c = 0
for i in range(n - 2):
	p = l[i] + l[i + 1] + l[i + 2]
	if p == 'xxx':
		c += 1
print(c)


import re
n = int(input())
s = input()
l = list(map(lambda x: max(len(x) - 2, 0), list(re.findall('x+', s))))
print(sum(l))


n = int(input())
s = input()
r = 0
a = 0
for i in range(n):
	if s[i] == 'x':
		a = a + 1
		if a > 2:
			r = r + 1
	else:
		a = 0
print(r)


c = int(input())
text = input()
count = 0
count_x = 0
for i in text:
	if i == 'x':
		count += 1
	else:
		count = 0
	if count >= 3:
		count_x += 1
print(count_x)


a = int(input())
b = input()
cs = 0
d = 0
for i in b:
	if i == 'x':
		d += 1
	if i != 'x':
		if d >= 3:
			cs += d - 2
		d = 0
if d >= 3:
	cs += d - 2
print(cs)


n = input()
s = input()
count = 0
for i in range(len(s) - 2):
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		count = count + 1
print(count)


n = int(input())
l = list(input())
c = 0
for i in range(2, len(l)):
	if l[i] == 'x' and l[i - 1] == 'x' and (l[i - 2] == 'x'):
		c += 1
print(c)


c = ans = 0
k = int(input())
s = input()
for i in s:
	if i == 'x':
		c += 1
	else:
		c = 0
	if c >= 3:
		ans += 1
print(ans)


n = int(input())
p = input()
cont = 0
s = 0
for i in range(n):
	if p[i] == 'x':
		cont += 1
	else:
		if cont > 2:
			s += cont - 2
		cont = 0
if cont > 2:
	s += cont - 2
print(s)


n = int(input())
s = input()
l = []
for i in range(n):
	if s[i] == 'x':
		c = 1
		for j in range(i + 1, n):
			if s[j] != 'x':
				break
			c += 1
		l.append(c)
c = 0
for i in l:
	if i >= 3:
		c += 1
print(c)


import re
k = int(input())
r = input()
p = re.compile('x{3,}')
l = p.findall(r)
c = 0
for i in l:
	c += len(i) - 2
print(c)


n = int(input())
s = input()
t = ans = 0
for i in range(n + 1):
	if i < n and s[i] == 'x':
		t += 1
	elif t != 0:
		ans += max(0, t - 2)
		t = 0
print(ans)


import re
_ = input()
xs = input()
threes = re.findall('[x]{3,}', xs)
reduction = 0
for three in threes:
	reduction += len(three) - 2
print(reduction)


b = input()
a = input()
marker = True
len_x = 0
res = 0
for s in a:
	if s == 'x' and marker:
		marker = False
		len_x += 1
	elif s == 'x' and (not marker):
		len_x += 1
	elif s != 'x' and (not marker):
		if len_x >= 3:
			res += len_x - 2
			marker = True
			len_x = 0
		else:
			marker = True
			len_x = 0
	else:
		continue
if not marker:
	if len_x >= 3:
		res += len_x - 2
		marker = True
		len_x = 0
	else:
		marker = True
		len_x = 0
print(res)


n = int(input())
word = input()
length = ''
count = 1
countx = 0
for i in range(1, len(word)):
	if word[i - 1] == word[i] == 'x':
		count += 1
		if i == len(word) - 1:
			if count >= 3:
				countx += count - 2
	else:
		if count >= 3:
			countx += count - 2
		count = 1
print(countx)


n = int(input())
s = input()
if 'xxx' not in s:
	print(0)
	exit()
originalSize = len(s)
while 'xxx' in s:
	s = s.replace('xxx', 'xx', 9999)
newSize = len(s)
print(originalSize - newSize)


def CountOccurrences(string, substring):
	count = 0
	start = 0
	while start < len(string):
		flag = string.find(substring, start)
		if flag != -1:
			start = flag + 1
			count += 1
		else:
			return count
n = int(input())
s = input()
p = CountOccurrences(s, 'xxx')
print(p)


n = int(input())
word = str(input())
s = 0
if n == len(word):
	while 'xxx' in word:
		word = word.replace('xxx', 'xx', 1)
		s += 1
print(s)


n = int(input())
string = input()
count = 1
r = 0
for i in string:
	if i == 'x':
		if count < 3:
			count = count + 1
		else:
			r = r + 1
	else:
		count = 1
print(r)


a = int(input())
s = input()
c = 0
ans = 0
for i in s:
	if i == 'x':
		c += 1
		if c > 2:
			ans += 1
	else:
		c = 0
print(ans)


n = int(input())
niz = input().strip()
count = 0
i = 0
while i + 2 < len(niz):
	if niz[i:i + 3] == 'xxx':
		niz = niz[:i + 2] + niz[i + 3:]
		count += 1
		i = 0
	else:
		i += 1
print(count)


n = int(input())
s = input()
count = 0
ans = 0
for x in s:
	if x == 'x':
		count += 1
	else:
		ans = ans + max(0, count - 2)
		count = 0
ans = ans + max(0, count - 2)
print(ans)


import re
n = int(input())
name = input()
sum = 0
f = re.findall('[x]+', name)
for i in f:
	slen = len(i)
	if slen > 2:
		sum += slen - 2
print(sum)


x = int(input())
y = input()
xy = 0
for i in range(x - 2):
	if y[i] == 'x' and y[i + 1] == 'x' and (y[i + 2] == 'x'):
		xy += 1
print(xy)


n = int(input())
name = input().strip()
result = 0
times = 0
for char in name:
	if char == 'x':
		times += 1
		if times >= 3:
			result += 1
	else:
		times = 0
print(result)


import re
input()
s = input().strip()
o = re.sub('x{3,}', 'xx', s)
print(len(s) - len(o))


n = int(input())
s = input()
l = []
count = 0
for i in s:
	if i == 'x':
		count += 1
	else:
		l.append(count)
		count = 0
l.append(count)
ans = 0
for i in l:
	ans += max(0, i - 2)
print(ans)


import re
input()
s = input()
print(len(s) - len(re.sub('x{3,}', 'xx', s)))


n = int(input())
u = list(input())
dx = 0
ans = 0
for i in range(n):
	if u[i] == 'x':
		dx += 1
	else:
		dx = 0
	if dx > 2:
		ans += 1
		dx -= 1
print(ans)


n = int(input())
s = input()
if not 'xxx' in s:
	print(0)
else:
	x = []
	c = 0
	for i in s:
		if i == 'x':
			c += 1
		else:
			if c > 2:
				x.append(c - 2)
			c = 0
	if c > 2:
		x.append(c - 2)
	print(sum(x))


n = int(input())
s = input()
ans = 0
cnt = 0
for i in s:
	if i == 'x':
		cnt += 1
		if cnt >= 3:
			ans += 1
	else:
		cnt = 0
print(ans)


n = int(input())
a = str(input(''))
c = list(a)
sum = int(0)
k = int(0)
j = int(0)
for i in range(0, n):
	if c[i] == 'x':
		sum = sum + 1
		if sum == 3:
			j = j + 1
			sum = sum - 1
	else:
		sum = int(0)
print(j)


n1 = int(input())
a = input()
count = 0
s = 0
for x in a:
	if x == 'x':
		s += 1
		if s >= 3:
			count += 1
	else:
		s = 0
print(count)


(n, s) = (int(input()), input())
print(sum((s[i:i + 3] == 'xxx' for i in range(n))))


n = int(input())
total = n
xxx_count = 0
for c in input():
	if c == 'x':
		xxx_count += 1
	else:
		xxx_count = 0
	if xxx_count == 3:
		xxx_count -= 1
		n -= 1
print(total - n)


def extra_x(name):
	is_last_x = False
	x_counts = list()
	for c in name:
		if c == 'x':
			if is_last_x:
				x_counts[-1] += 1
			else:
				x_counts.append(1)
				is_last_x = True
		else:
			is_last_x = False
	result = 0
	for sub in x_counts:
		repeats = sub // 3
		remaining = sub % 3
		if repeats:
			result += (repeats - 1) * 3 + 1
			result += remaining
	return result
input()
result = extra_x(input())
print(result)


import sys, math
from collections import defaultdict, deque, Counter
import itertools
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))
n = inp()
a = input()
res = 0
for i in range(n - 2):
	if a[i:i + 3] == 'xxx':
		res += 1
print(res)


def read_ints():
	return list(map(int, input().strip().split()))

def read_int():
	return read_ints()[0]
n = read_int()
wrd = input().strip()
suma = 0
for (i, _) in enumerate(wrd):
	if wrd[i:].startswith('xxx'):
		suma += 1
print(suma)


n = int(input())
s = input()
res = 0
while 'xxx' in s:
	res += s.count('xxx')
	s = s.replace('xxx', 'xx')
print(res)


n = int(input())
string = input()
res = 0
count = 1
for i in range(n - 1):
	if string[i] == 'x' and string[i] == string[i + 1]:
		count += 1
		if count >= 3:
			res += 1
	else:
		count = 1
print(res)


import sys
n = int(input())
s = input()
ans = 0
ptr = 0
if n == 3:
	if s == 'xxx':
		print(1)
		sys.exit()
	else:
		print(0)
		sys.exit()
for i in s:
	if i == 'x':
		ptr += 1
	elif ptr >= 3:
		ans += ptr - 2
		ptr = 0
	else:
		ptr = 0
if s[len(s) - 3:] == 'xxx':
	ans += ptr - 2
print(ans)


p = int(input())
str = input()
u = p
n = 1
k = 0
count = 0
while n <= p:
	i = k
	k = str[n - 1:n]
	if n == 1 and k == 'x':
		count = count + 1
	elif k == 'x':
		count = count + 1
	if count == 3:
		u = u - 1
		count = count - 1
	elif i != k and k != 'x':
		count = 0
	n = n + 1
print(p - u)


n = int(input())
s = input()
i = 0
ans = 0
while i != n:
	if s[i] != 'x':
		i += 1
	else:
		cnt = 0
		while i != n and s[i] == 'x':
			i += 1
			cnt += 1
		ans += max(0, cnt - 2)
print(ans)


n = int(input())
t = list(input())
ans = 0
p = 0
l = []
bb = 0
i = 0
while i < n:
	if t[i] == 'x':
		if p == 0:
			p = 1
			ans += 1
		else:
			ans += 1
	else:
		l.append(ans)
		ans = 0
		p = 0
	i += 1
l.append(ans)
for i in range(len(l)):
	if l[i] > 2:
		bb += l[i] - 2
print(bb)


n = int(input())
a = input()
ans = 0
i = a.find('xxx')
while i != -1:
	a = a[:i] + a[i + 1:]
	ans += 1
	i = a.find('xxx')
print(ans)


n = int(input())
ch = input()
ans = 0
c = 0
for i in range(n):
	if ch[i] == 'x':
		c += 1
	if ch[i] == 'x' and i == n - 1 or ch[i] != 'x':
		if c >= 3:
			ans += c - 2
		c = 0
print(ans)


n = int(input())
s = list(input())
ans = 0
cnt = 0
isx = False
for i in range(len(s)):
	if isx:
		if s[i] == 'x':
			cnt += 1
		else:
			if cnt > 2:
				ans += cnt - 2
			cnt = 0
			isx = False
	elif s[i] == 'x':
		cnt = 1
		isx = True
else:
	if cnt > 2:
		ans += cnt - 2
print(ans)


n = int(input())
f = input()
cX = []
count = 0
for x in range(n):
	if f[x] == 'x':
		count += 1
	else:
		cX.append(count)
		count = 0
cX.append(count)
t = 0
for x in range(len(cX)):
	if cX[x] >= 3:
		t += cX[x] - 2
print(t)


n = int(input())
st = input()
fummy = 0
for x in range(n - 2):
	if st[x] == 'x' and st[x + 1] == 'x' and (st[x + 2] == 'x'):
		fummy += 1
print(fummy)


def f(s):
	count = 0
	slen = len(s)
	for i in range(slen - 2):
		if s[i:i + 3] == 'xxx':
			count += 1
	return count
l = int(input())
s = input().strip()
print(f(s))


n = int(input())
s = input()
if s.find('xxx') > -1:
	for i in range(0, len(s)):
		if s[i] != 'x':
			s = s.replace(s[i], ' ')
	l = s.split(' ')
	c = 0
	for i in l:
		if len(i) >= 3:
			c += len(i) - 2
	print(c)
else:
	print('0')


input()
s = input()
n = []
tmp = 0
for i in s:
	if i == 'x':
		tmp += 1
	else:
		n.append(tmp)
		tmp = 0
if tmp != 0:
	n.append(tmp)
res = 0
for i in n:
	if i > 2:
		res += i - 2
if res < 0:
	res = 0
print(res)


n = int(input())
inp = input()
is_forbidden = False
res = 0
num = 0
for i in range(n):
	if inp[i] == 'x':
		num += 1
	else:
		num = 0
	if num == 3:
		num -= 1
		res += 1
print(res)


n = int(input())
string = input()
countX = 0
countlist = []
for i in range(1, len(string) + 1):
	if string[i - 1] == 'x':
		countX += 1
	if string[i - 1] != 'x' or i == len(string):
		countlist.append(countX)
		countX = 0
deleteNum = 0
for i in countlist:
	if i < 3:
		pass
	else:
		deleteNum += i - 2
print(deleteNum)


a = []
n = int(input())
s = input()
for i in range(n - 2):
	a.append(s[i:i + 3])
if 'xxx' not in set(a):
	print(0)
else:
	print(a.count('xxx'))


n = int(input())
s = input()
ans = 0
tmp = 0
for elem in s:
	if elem != 'x':
		tmp = 0
	else:
		tmp = tmp + 1
		if tmp > 2:
			ans = ans + 1
print(ans)


n = int(input().strip())
s = input()

def find():
	ans = []
	l = 0
	for i in range(0, len(s) - 1):
		if s[i] == 'x' and s[i + 1] == 'x':
			l += 1
		else:
			l += 1
			if l >= 3:
				ans.append(l)
			l = 0
	l += 1
	if l >= 3:
		ans.append(l)
	return ans
xx = find()
if xx == None:
	print(0)
else:
	ans = 0
	for x in xx:
		ans += x - 2
	print(ans)


n = int(input())
s = str(input())
p = set(s)
q = len(p)
if q == 1 and 'x' in p:
	print(len(s) - 2)
elif 'xxx' not in s:
	print('0')
else:
	x = 0
	for j in range(n - 2):
		if s[j:j + 3] == 'xxx':
			x = x + 1
	print(x)


n = int(input())
s = input()
if 'xxx' not in s:
	print(0)
else:
	ans = 0
	c = 0
	for i in s:
		if i == 'x':
			c += 1
		else:
			c = 0
		if c == 3:
			ans += 1
			c -= 1
	print(ans)


num = int(input())
enter = input()
counter = 0
for i in range(len(enter) - 2):
	if enter[i] == 'x' and enter[i] == enter[i + 1] and (enter[i] == enter[i + 2]):
		counter += 1
print(counter)


n = int(input())
s = input()
lis = [0] * n
j = 0
for i in range(n):
	if s[i] == 'x':
		lis[j] += 1
	else:
		j += 1
ans = 0
flag = False
for i in lis:
	if i >= 3:
		flag = True
		ans += i - 2
if flag == True:
	print(ans)
else:
	print(0)


import sys
input = sys.stdin.readline

def solve(n, t):
	i = 0
	count = 0
	while i < n:
		if t[i] == 'x':
			streak = 0
			while i < n and t[i] == 'x':
				streak += 1
				i += 1
			if streak >= 3:
				count += streak - 2
		else:
			i += 1
	return count
n = int(input())
t = input().rstrip()
print(solve(n, t))


n = int(input())
s = input()
n = 0
res = 0
for x in s:
	if x == 'x':
		n += 1
		if n >= 3:
			res += 1
	else:
		n = 0
print(res)


n = int(input())
text = input()
ans = 0
while text.count('xxx') > 0:
	ans += text.count('xxx')
	text = text.replace('xxx', 'xx')
print(ans)


n = int(input())
s = input()
result = 0
for i in range(2, n):
	if s[i - 2] == s[i - 1] == s[i] == 'x':
		result += 1
print(result)


n = int(input())
cnt = 0
s = input()
for i in range(2, n):
	if s[i] + s[i - 1] + s[i - 2] == 'xxx':
		cnt += 1
print(cnt)


def solve(test):
	ans = 0
	n = int(input())
	s = input() + 'a'
	tmp = 0
	for c in s:
		if c == 'x':
			tmp += 1
		else:
			ans += max(0, tmp - 2)
			tmp = 0
	print(ans)
t = 1
for _ in range(t):
	solve(_ + 1)


import re
N = int(input())
print(sum((len(g) - 2 for g in re.findall('xxx+', input()) if len(g) >= 3)))


n = int(input())
s = input()
new_s = ''
f = False
i = 0
while i != n:
	if s[i] == 'x':
		if new_s[-2:] != 'xx':
			new_s += 'x'
		i += 1
	else:
		new_s += s[i]
		i += 1
print(len(s) - len(new_s))


def solve():
	n = int(input())
	s = input()
	(curr, best) = (0, 0)
	ans = 0
	for c in s:
		if c == 'x':
			curr += 1
		else:
			ans += max(0, curr - 2)
			curr = 0
	ans += max(0, curr - 2)
	print(ans)
solve()


n = int(input())
str = input()
cntr = 0
res = 0
for i in str:
	if i == 'x':
		cntr += 1
		if cntr >= 3:
			res += 1
	else:
		cntr = 0
print(res)


n = int(input())
s = input()
ans = 0
c = 0
for i in s:
	if i == 'x':
		c += 1
	else:
		ans += max(c - 2, 0)
		c = 0
if c > 2:
	ans += c - 2
print(ans)


n = int(input())
a = input()
c = 0
i = 0
while i + 2 < n:
	if a[i] == 'x' and a[i + 1] == 'x' and (a[i + 2] == 'x'):
		c += 1
	i += 1
print(c)


input()
s = input()
k = 0
count = 0
for i in range(len(s)):
	if s[i] == 'x':
		k += 1
	else:
		if k > 2:
			count += k - 2
		k = 0
if k > 2:
	count += k - 2
print(count)


n = int(input())
a = list(input())
p = a[:]
for i in range(-1, -n + 1, -1):
	if a[i] == 'x' and a[i] == a[i - 1] == a[i - 2]:
		p.pop(-1)
print(n - len(p))


(n, seq) = (int(input()), list(input()))
print(list(zip(seq, seq[1:], seq[2:])).count(('x', 'x', 'x')))


n = int(input())
s = input()
stk = []
ans = 0
for c in s:
	if c == 'x' and len(stk) >= 2 and (stk[-2] == 'x') and (stk[-1] == 'x'):
		ans += 1
	else:
		stk.append(c)
print(ans)


x = int(input())
s = input()
co = 0
try:
	for i in range(x):
		try:
			if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
				co += 1
		except:
			pass
except:
	pass
print(co)


n = int(input())
lis = list(input())
i = 0
count = 0
rm = 0
while i < n:
	if lis[i] == 'x':
		count += 1
	else:
		count = 0
	if count >= 3:
		lis.pop(i)
		rm += 1
		n -= 1
		i -= 1
	i += 1
print(rm)


n = int(input())
s = input()
cnt = 0
previ = 0
prev = s[0]
for i in range(n):
	if s[i] == prev:
		continue
	else:
		if prev == 'x':
			cnt += max(0, i - previ - 2)
		previ = i
		prev = s[i]
if prev == 'x':
	cnt += max(0, i - previ - 1)
print(cnt)


a = int(input())
b = input()
c = 0
d = 0
for i in b:
	if i == 'x':
		c += 1
	elif c > 3:
		d += c - 2
		c = 0
	elif c == 3:
		d += 1
		c = 0
	else:
		c = 0
if c != 0:
	if c == 3:
		d += 1
	elif c > 3:
		d += c - 2
print(d)


import bisect
n = int(input())
arr = input()
ans = 0
cnt = 0
for i in arr:
	if i == 'x':
		cnt += 1
	elif cnt >= 3:
		ans += cnt - 2
		cnt = 0
	else:
		cnt = 0
if cnt >= 3:
	ans += cnt - 2
print(ans)


n = int(input())
s = input() + 'h'
res = 0
x_in_row = 0
for i in s:
	if i == 'x':
		x_in_row += 1
	elif x_in_row > 0:
		res += max(0, x_in_row - 2)
		x_in_row = 0
print(res)


l = int(input())
s = input()
x_count = 0
ans = 0
for i in range(l):
	if s[i] == 'x' and x_count == 2:
		ans += 1
	elif s[i] != 'x':
		x_count = 0
	else:
		x_count += 1
print(ans)


n = int(input())
a = list(input())
ans = 0
i = 0
p = 0
while i < n:
	if a[i] == 'x':
		p = 0
		while i < n and a[i] == 'x':
			p += 1
			i += 1
		if p > 2:
			ans += p - 2
			p = 0
	i += 1
print(ans)


n = int(input())
s = input()
(k, num) = (0, 0)
for i in range(n):
	if s[i] == 'x':
		k += 1
for p in range(n - 2):
	if s[p] == s[p + 1] and s[p] == 'x' and (s[p] == s[p + 2]):
		num += 1
print(num)


n = int(input())
a = input()
x = 'xxx'
k = 0
for i in range(len(a) - 2):
	if a[i:i + 3] == x:
		k += 1
print(k)


a = int(input())
b = input()
counterx = 0
counter = 0
for i in range(0, a):
	if b[i] == 'x':
		counterx += 1
	if b[i] != 'x':
		counterx = 0
	if counterx > 2:
		counter += 1
print(counter)


a = int(input())
b = input()
l = []
dis = {}
for x in range(0, a - 2):
	sub = b[x:x + 3]
	l.append(sub)
	c = l.count(sub)
	dis[sub] = c
if 'xxx' not in dis.keys():
	dis['xxx'] = 0
print(dis['xxx'])


n = int(input())
s = input()
c = 0
while 'xxx' in s:
	i = s.index('xxx')
	s = list(s)
	del s[i]
	s = ''.join(s)
	c += 1
print(c)


a = int(input())
b = list(map(str, input()))
c = 0
for i in range(len(b) - 2):
	if b[i] == 'x' and b[i + 1] == 'x' and (b[i + 2] == 'x'):
		c += 1
print(c)


n = int(input())
c = input()
w = []
count = 0
for i in range(len(c) - 2):
	if c[i:i + 3] == 'xxx':
		count += 1
print(count)


import re
n = int(input())
print(len(re.findall('(?=xxx)', input())))


n = int(input())
s = input()
count = 0
to_delete = 0
for ch in s:
	if ch == 'x':
		count += 1
		if count > 2:
			to_delete += 1
	else:
		count = 0
print(to_delete)


n = int(input())
s = input()
sum1 = 0
if 'xxx' not in s:
	print(0)
else:
	count = 0
	index2 = 0
	while True:
		index1 = s.find('xxx', index2)
		if index1 == -1:
			break
		for i in range(index1, len(s)):
			if s[i] != 'x':
				index2 = i
				sum1 += index2 - index1 - 2
				break
			if i == len(s) - 1:
				index2 = len(s)
				sum1 += index2 - index1 - 2
				count = 1
				break
		if count == 1:
			break
	print(sum1)


n = input()
s = input()
k = 0
while 'xxx' in s:
	k += 1
	s = s[:s.index('xxx')] + s[s.index('xxx') + 1:]
print(k)


n = int(input())
file_name = input()
num = 0
if 'xxx' not in file_name:
	print('0')
else:
	for _ in range(len(file_name)):
		if 'xxx' in file_name:
			file_name = file_name.replace('xxx', 'xx', 1)
			num += 1
	print(num)


n = int(input())
s = input()
xc = 0
res = 0
for i in s:
	if i == 'x':
		xc += 1
	else:
		if xc >= 3:
			res += xc - 2
		xc = 0
if xc >= 3:
	res += xc - 2
print(res)


import re
n = int(input())
s = str(input())
print(len(re.findall('(?=xxx)', s)))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
n = l()[0]
s = input()
i = 0
ans = 0
while i < n:
	if s[i] != 'x':
		i += 1
		continue
	k = 0
	while i + k < n and s[i + k] == 'x':
		k += 1
	if k >= 3:
		ans += k - 2
	i += k
print(ans)


n = int(input())
string = input()
counter = int()
result = int()
for letter in string:
	if letter == 'x':
		counter += 1
		if counter >= 3:
			result += 1
	else:
		counter = 0
print(result)


n = int(input())
c = input()
print(sum((1 for (i, l) in enumerate(c) if c[i:i + 3] == 'xxx')))


n = int(input())
count = 0
pop = list(input())
y = 0
for x in range(5555):
	if y + 3 <= len(pop):
		if ''.join(pop[y:y + 3]) == 'xxx':
			count += 1
			y += 1
		else:
			y += 1
print(count)


t = int(input())
str = input()
cnt = 0
lent = t - 2
for i in range(0, lent):
	if str[i] == 'x' and str[i + 1] == 'x' and (str[i + 2] == 'x'):
		cnt += 1
print(cnt)


n = int(input())
s = input()
count = 0
l = []
for i in s:
	if i == 'x':
		count += 1
	elif count != 0:
		l.append(count)
		count = 0
if s[-1] == 'x':
	l.append(count)
rem = 0
for j in l:
	if j > 2:
		rem += j - 2
print(rem)


T_ON = 0
DEBUG_ON = 0
MOD = 998244353

def solve():
	n = read_int()
	s = input()
	count = 0
	i = 0
	while i < n:
		if s[i] != 'x':
			i += 1
			continue
		j = i + 1
		while j < n and s[j] == 'x':
			j += 1
		count += max(0, j - i - 2)
		i = j
	print(count)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


s = input()
s = input()
a = 0
i = 0
while 1:
	if i == len(s):
		break
	if s[i] != 'x':
		i += 1
		continue
	cur = 1
	i += 1
	while i < len(s) and s[i] == 'x':
		cur += 1
		i += 1
	a += max(cur - 2, 0)
print(a)


input()
print(sum((max(0, len(r) - 2) for r in ''.join((' x'[x == 'x'] for x in input())).split())))


n = int(input())
s = input()
m = 0
if 'xxx' not in s:
	print(0)
	quit()
else:
	for i in range(n - 2):
		if s[i] == s[i + 1] == s[i + 2] == 'x':
			m += 1
print(m)


n = int(input())
inp = input()
ans = 0
i = 0
while i < n - 2:
	if inp[i] == inp[i + 1] and inp[i] == 'x':
		i += 2
		while i < n and inp[i] == 'x':
			ans += 1
			i += 1
	else:
		i += 1
print(ans)


n = int(input())
a = input()
number = 0
i = 0
while i < n:
	if a[i] != 'x':
		i += 1
		continue
	count = 1
	for j in range(i + 1, n):
		if a[j] == 'x':
			count += 1
		else:
			break
	if count >= 3:
		number += count - 2
	i += count
print(number)


R = lambda : map(int, input().split())
n = int(input())
s = input()
import re
ls = re.findall('x{3,}', s)
print(sum(map(lambda s: len(s) - 2, ls)))


def main():
	_ = input()
	string = input()
	cnt = 0
	num = 0
	for char in string:
		if char == 'x':
			cnt += 1
		else:
			cnt = 0
		if cnt > 2:
			num += 1
	print(num)
main()


a = input()
q = input()
b = list(q)
c = len(b)
d = []
m = ''
l = 0
for i in range(len(b)):
	if len(b) <= 2 or i == len(b) - 2:
		break
	if b[i] == 'x' and b[i + 1] == 'x' and (b[i + 2] == 'x'):
		d.append(i + 2)
for j in d:
	del b[j - l]
	l += 1
print(len(q) - len(b))


n = int(input())
a = input()
lis = []
count = 0
no = 0
for i in range(n):
	if a[i] == 'x':
		lis.append(a[i])
		count += 1
	if a[i] != 'x':
		count = 0
	if count == 3:
		no += 1
		lis.remove(a[i])
		count = 2
print(no)


n = int(input())
s = input()
st = 0
res = 0
for i in range(n):
	if s[i] == 'x' and (i == 0 or s[i - 1] != 'x'):
		st = i
	if s[i] == 'x' and (i == n - 1 or s[i + 1] != 'x'):
		cur_len = i - st + 1
		if cur_len >= 3:
			res += cur_len - 2
print(res)


from itertools import groupby
n = int(input())
s = []
for i in groupby(input(), lambda x: x == 'x'):
	s.append(list(i[1]))
ans = 0
for i in s:
	if i[0] == 'x':
		ans += max(0, len(i) - 2)
print(ans)


n = int(input())
a = input()
b = 0
z = 0
for i in range(n):
	if a[i] == 'x':
		b += 1
		if b >= 3:
			z += 1
	else:
		b = 0
print(z)


n = int(input())
name = list(input())
x_row = 0
for i in range(n - 2):
	if name[i] == 'x' and name[i] == name[i + 1] and (name[i] == name[i + 2]):
		x_row += 1
print(x_row)


n = int(input())
s = input()
remove = 0
count = 0
max_x = 0
for i in range(n):
	if s[i] == 'x':
		count += 1
	else:
		if count > 2:
			remove += count - 2
		count = 0
if count > 2:
	remove += count - 2
print(remove)


n = int(input())
m = input()
a = []
c = 0
for i in m:
	if i == 'x':
		c += 1
	elif c != 0:
		a.append(c)
		c = 0
if c != 0:
	a.append(c)
sol = 0
for i in a:
	if i >= 3:
		sol += i - 2
print(sol)


N = int(input())
str = input()
count = 0
for i in range(len(str) - 2):
	if str[i] == 'x' and str[i + 1] == 'x' and (str[i + 2] == 'x'):
		count += 1
print(count)


n = int(input())
string = input()
cnts = []
cnt = 0
for i in range(n):
	if string[i] == 'x':
		cnt += 1
	else:
		if cnt >= 3:
			cnts.append(cnt - 2)
		cnt = 0
else:
	if cnt >= 3:
		cnts.append(cnt - 2)
print(sum(cnts))


def filen(s):
	ls = list(s)
	c = 0
	for i in range(2, len(ls)):
		if ls[i - 1] == 'x' and ls[i - 2] == 'x' and (ls[i] == 'x'):
			c += 1
	return c
n = int(input())
s = input()
print(filen(s))


x = int(input())
n = input()
jumlah = 0
for i in range(len(n) - 2):
	if n[i] == 'x' and n[i + 1] == 'x' and (n[i + 2] == 'x'):
		jumlah += 1
print(jumlah)


input()
f = input()
if f.count('xxx') == 0:
	print('0')
else:
	i = 0
	p = f.find('xxx')
	while p != -1:
		f = f.replace('xxx', 'xx', 1)
		i += 1
		p = f.find('xxx')
	print(i)


n = int(input())
s = input()
ans = i = 0
while i < n:
	j = i
	while i < n and s[i] == 'x':
		i += 1
	ans += max(0, i - j - 2)
	i += 1
print(ans)


(count, result) = (0, 0)
number = int(input())
data = input().strip()
if number < 3:
	print(0)
else:
	for m in range(0, number):
		if data[m] == 'x':
			count += 1
		else:
			if count > 2:
				result += count - 2
			count = 0
	if count > 2:
		result += count - 2
	print(result)


n = int(input())
s = input()
if 'xxx' not in s:
	print(0)
else:
	i = 0
	j = 0
	ans = 0
	while i < n:
		if s[i] == 'x':
			j = i
			while s[j] == 'x':
				j += 1
				if j == n:
					break
			if j - i >= 3:
				ans += j - i - 2
			i = j
		else:
			i += 1
	print(ans)


tam = int(input())
s = input()
valorI = s.count('x')
while 'xxx' in s:
	newstr = s.replace('xxx', 'xx')
	s = newstr
valorF = s.count('x')
print(valorI - valorF)


s = input()
first = int(s)
se = input()
l = 0
j = 0
i = 0
while i < first:
	k = 0
	while i < first and se[i] == 'x':
		k = k + 1
		i = i + 1
	if k > 2:
		l = l + k - 2
	j = j + 1
	i = i + 1
print(l)


n = int(input())
s = input()
count = 0
l = []
for i in range(n):
	if s[i] == 'x':
		count += 1
		if count == 3:
			l.append(count)
		elif count > 3:
			l[-1] += 1
	else:
		count = 0
ans = 0
for i in range(len(l)):
	ans += l[i] - 2
print(ans)


n = int(input())
c = input()
k = 0
if n < 3:
	print('0')
else:
	for i in range(n - 2):
		if c[i] + c[i + 1] + c[i + 2] == 'xxx':
			k += 1
	print(k)


n = int(input())
s = str(input())
k = 0
for i in range(len(s) - 2):
	if s[i:i + 3] == 'xxx':
		k += 1
print(k)


n = int(input())
s = str(input())
count = 0
i = 0
while n - 3 >= i:
	if (s[i] == 'x' and s[i + 1] == 'x') and s[i + 2] == 'x':
		count += 1
	i += 1
print(count)


n = int(input())
s = input()
count = 1
c = 0
res = 0
for i in range(n - 1):
	if s[i] == 'x' and s[i] == s[i + 1]:
		count += 1
		if count >= 3:
			res += 1
	elif s[i] == 'x' and s[i] != s[i + 1]:
		c = count
		count = 1
print(res)


f = lambda : map(int, input().split())
n = int(input())
s = input()
(c, cl) = (0, [])
for i in range(n):
	if s[i] == 'x':
		c += 1
	else:
		cl.append(c)
		c = 0
cl.append(c)
print(sum((max(0, i - 2) for i in cl)))


length = int(input())
str1 = input().strip('\n')
str2 = ''
ans = 0
for i in range(length):
	if str1[i] == 'x':
		str2 += 'x'
	else:
		str2 += ' '
list1 = [v for v in str2.split()]
for j in range(len(list1)):
	if len(list1[j]) >= 3:
		ans += len(list1[j]) - 2
	else:
		pass
print(ans)


input('')
name = input('')
if 'xxx' not in name:
	print(0)
else:
	count = 0
	while 'xxx' in name:
		index = name.index('xxx')
		name = name[:index] + name[index + 1:]
		count += 1
	print(count)


n = int(input())
s = input()
count = 0
warning = 0
for each in s:
	if each != 'x':
		count = 0
		continue
	elif each == 'x':
		count += 1
	if count > 2:
		warning += 1
print(warning)


n = int(input())
str = list(input())
ans = 0
n = 0
for i in str:
	if i == 'x':
		ans += 1
	else:
		ans = 0
	if ans == 3:
		n += 1
		ans -= 1
print(n)


n = int(input())
s = list(input())
con = 0
mov = 0
for i in range(n):
	if s[i] == 'x':
		con += 1
	else:
		con = 0
	if con == 3:
		mov += 1
		if i + 1 < n and s[i + 1] == 'x':
			con = 2
		else:
			con = 0
print(mov)


banyakChar = int(input())
stringNya = input()
banyakX = 0
hapus = 0
countI = 0
for a in stringNya:
	if a == 'x':
		banyakX += 1
	else:
		if banyakX > 2:
			hapus += banyakX - 2
		banyakX = 0
if banyakX > 2:
	hapus += banyakX - 2
	banyakX = 0
print(hapus)


z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0:
			return 0
	return 1
z = input
n = int(z())
l = list(z())
ans = 0
c = 0
for i in l:
	if i == 'x':
		c += 1
	else:
		c = 0
	if c >= 3:
		ans += 1
print(ans)


n = int(input())
S = input()
S = S + '$$'
count = 0
total = 0
for i in range(n + 1):
	if S[i] == 'x':
		count += 1
	else:
		if count >= 3:
			total += count - 2
		count = 0
print(total)


n = int(input())
s = input()
total = 0
while s.count('xxx'):
	index = s.index('xxx')
	s = list(s)
	s.pop(index)
	total += 1
	s = ''.join(s)
print(total)


n = int(input())
name = input()
letters = list(name)
counter = 0
ans = 0
for i in letters:
	if i == 'x':
		counter += 1
	else:
		counter = 0
	if counter >= 3:
		ans += 1
print(ans)


c = int(input())
n = input()
i = 0
while True:
	if 'xxx' in n:
		n = n[n.find('xxx') + 1:]
		i += 1
	else:
		print(i)
		break


n = input()
s = input()
count = 0
i = 0
while i < len(s) - 3:
	s2 = s[i:i + 3]
	if s2 == 'xxx':
		s = s[0:i + 1] + s[i + 2:]
		count += 1
		i = max(0, i - 2)
	else:
		i += 1
if s[-3:] == 'xxx':
	count += 1
print(count)


b = int(input())
i = 2
e = 0
a = str(input())
for i in range(2, b):
	if a[i] + a[i - 1] + a[i - 2] == 'xxx':
		e += 1
print(e)


n = int(input())
a = list(input())
(c, d) = (0, 0)
for i in range(n - 1):
	if a[i] == 'x' and a[i] == a[i + 1]:
		c += 1
		if c > 2:
			d += 1
	elif a[i] == 'x' and a[i] != a[i + 1]:
		c += 1
		if c > 2:
			d += 1
		c = 0
	if i == n - 2 and a[n - 1] == 'x':
		c += 1
		if c > 2:
			d += 1
print(d)


n = int(input())
fn = input()
ans = 0
cnt = 0
for c in fn:
	if c == 'x':
		cnt += 1
		if cnt == 3:
			cnt -= 1
			ans += 1
	else:
		cnt = 0
print(ans)


def main():
	n = int(input())
	s = input()
	ans = 0
	i = 0
	while i < len(s):
		if s[i] == 'x':
			l = 1
			i += 1
			while i < len(s) and s[i] == 'x':
				l += 1
				i += 1
			ans += l - 2 if l > 2 else 0
		i += 1
	print(ans)
main()


N = int(input())
file_name = input()
ans = 0
x = 0
for i in range(N):
	if file_name[i] == 'x':
		x += 1
	else:
		if x > 2:
			ans += x - 2
		x = 0
if x > 2:
	ans += x - 2
print(ans)


n = int(input())
s = input()[:n]
cnt = 0
to_rem = 0
for el in s:
	if el == 'x':
		cnt = cnt + 1
	elif el != 'x':
		cnt = 0
	if cnt == 3 or cnt > 3:
		to_rem = to_rem + 1
print(to_rem)


n = int(input())
s = input()
count = 0
xxx = []
sub_s = 0
for i in s:
	if i == 'x':
		sub_s += 1
	else:
		xxx.append(sub_s)
		sub_s = 0
xxx.append(sub_s)
for x in xxx:
	if x > 2:
		count += x - 2
print(count)


n = int(input())
s = [x for x in input()]
length = len(s)
i = 0
ans = 0
while i < len(s):
	while i + 2 < len(s) and s[i] == 'x' and (s[i + 1] == 'x') and (s[i + 2] == 'x'):
		ans += 1
		s.pop(i)
	i += 1
print(ans)


n = int(input())
s = input()
while s.count('xxx') > 0:
	s = s.replace('xxx', 'xx')
print(n - len(s))


input()
s = input()
s_copy = s
while s_copy.find('xxx') != -1:
	s_copy = s_copy.replace('xxx', 'xx')
print(len(s) - len(s_copy))


count = 0
input()
y = input()
for r in range(len(y)):
	x = y[r:r + 3]
	if x == 'xxx':
		count += 1
print(count)


n = int(input())
s = str(input())
c = 0
while 'xxx' in s:
	i = s.find('xxx')
	s = s[:i] + s[i + 1:]
	c += 1
print(c)


n = int(input())
mass = input()
(i, k) = (mass.find('xxx'), 0)
while i != -1:
	mass = mass[:i + 2] + mass[i + 3:]
	k += 1
	i = mass.find('xxx')
print(k)


n = int(input())
s = input()
if 'xxx' not in s:
	print(0)
else:
	cnt = 0
	while 'xxx' in s:
		cnt += 1
		i = s.index('xxx')
		l = list(s)
		l.pop(i)
		s = ''
		for i in l:
			s += i
	print(cnt)


def main():
	n = int(input())
	s = input()
	d = []
	st = ''
	for i in range(n):
		if s[i] == 'x':
			st += 'x'
		else:
			if len(st) >= 3:
				d.append(st)
			st = ''
	if len(st) != 0 and len(st) >= 3:
		d.append(st)
	s = 0
	for elem in d:
		s += len(elem) - 2
	print(s)
main()


n = int(input())
s = input()
t = 0
while 'xxx' in s:
	i = s.index('xxx')
	s = s[:i] + s[i + 1:]
	t += 1
print(t)


n = int(input())
s = str(input())
j = 2
count = 0
for i in range(n):
	if s[j] == 'x' and s[j - 1] == 'x' and (s[j - 2] == 'x'):
		s = s[:j] + s[j + 1:]
		count += 1
	else:
		j += 1
	if j == len(s):
		break
print(count)


n = int(input())
line = input()
array = list(line)
count = 0
for i in range(n - 2):
	if array[i] == 'x' and array[i + 1] == 'x' and (array[i + 2] == 'x'):
		count += 1
print(count)


length = int(input())
filename = input()
ans = 0
for i in range(2, length):
	if filename[i] == 'x' and filename[i - 1] == 'x' and (filename[i - 2] == 'x'):
		ans += 1
print(ans)


x = int(input())
c = input()
d = 0
for i in range(x - 2):
	if c[i] == c[i + 1] == c[i + 2] == 'x':
		d += 1
print(d)


qtd = int(input())
string = input()
res = 0
for i in range(1, qtd):
	if string[i] == 'x':
		try:
			if string[i - 1] == 'x':
				if string[i + 1] == 'x':
					res += 1
		except:
			pass
print(res)


n = input()
s = input()
ans = 0
f = 0
while f < len(s):
	if s[f] == 'x':
		c = 0
		while f < len(s) and s[f] == 'x':
			f += 1
			c += 1
		if c - 2 > 0:
			ans += c - 2
	f += 1
print(ans)


input()
a = input()
count = 0
x = 0
for i in a:
	if i == 'x':
		x += 1
	else:
		x = 0
	if x >= 3:
		count += x - 2
		x = 2
print(count)


n = int(input())
s = input()
ans = 0
while s.__contains__('xxx'):
	s = s[0:s.find('xxx') + 1] + s[s.find('xxx') + 2:]
	ans += 1
print(ans)


import re
n = int(input())
s = input()
pat = 'x{3,}'
ar = [len(i) - 2 for i in re.findall(pat, s)]
print(sum(ar))


n = int(input())
s = input()
sl = [i for i in s]
c = 0
x = s.find('xxx')
while x != -1:
	c += 1
	sl.pop(x)
	temp = ''
	for i in sl:
		temp += i
	x = temp.find('xxx')
print(c)


n = int(input())
s = input()
n = 0
while True:
	if 'xxx' in s:
		s = s[s.find('xxx') + 1:]
		n += 1
	else:
		break
print(n)


length = int(input())
filename = input()
result = 0
if length < 3:
	print(result)
else:
	index = 0
	while index <= length - 3:
		if filename[index:index + 3] == 'xxx':
			result += 1
			index += 1
		elif filename[index + 2] != 'x':
			index += 3
		else:
			index += 1
	print(result)


N = int(input())
S = input()
xlist = []
cnt = 0
for i in range(0, N):
	if S[i] == 'x':
		cnt += 1
	elif cnt != 0:
		xlist.append(cnt)
		cnt = 0
if cnt != 0:
	xlist.append(cnt)
sum = 0
for i in range(0, len(xlist)):
	if xlist[i] >= 3:
		sum += xlist[i] - 2
print(sum)


n = int(input())
s = 'xxx' + input()
n = [0] * n
j = 0
for i in range(3, len(s)):
	if s[i] == s[i % 3]:
		n[i - 3] = j
		j += 1
	elif s[i] != s[i % 3]:
		j = 0
j = 0
for i in range(len(n)):
	if n[i] >= 2:
		j += 1
print(j)


z = input
z()
l = z()
(c, d) = (0, 0)
for i in l:
	if i != 'x':
		c = 0
	if i == 'x':
		c += 1
	if c >= 3:
		d += 1
print(d)


import re
input()
a = re.findall('x{3,}', input())
print(sum(map(lambda s: len(s) - 2, a)))


t = int(input())
s = input()
ans = 0
i = 0
while i < t:
	count = 0
	while i < t and s[i] == 'x':
		count += 1
		i += 1
	else:
		i += 1
	if count >= 3:
		ans += count - 2
print(ans)


n = int(input())
s = input()
count = 0
for i in range(n - 2):
	x = s[i] + s[i + 1] + s[i + 2]
	if x == 'xxx':
		count += 1
print(count)


n = int(input())
k = input()
p = 0
for val in range(3, n + 1):
	f = ''
	for g in range(0, val):
		f += 'x'
	if f in k:
		for vb in range(0, n - val + 1):
			s = 0
			for d in range(vb, vb + val):
				if k[d] == 'x':
					s += 1
			if s == val:
				if vb - 1 >= 0 and vb + val < len(k):
					if k[vb - 1] != 'x' and k[vb + val] != 'x':
						p += val - 2
				elif vb - 1 < 0 and vb + val < len(k):
					if k[vb + val] != 'x':
						p += val - 2
				elif vb - 1 < 0 and vb + val >= len(k):
					p += val - 2
				elif vb - 1 >= 0 and vb + val >= len(k):
					if k[vb - 1] != 'x':
						p += val - 2
print(p)


import sys
from bisect import bisect_left, bisect_right
from collections import deque, Counter
from math import gcd, sqrt, factorial, ceil, log
from itertools import permutations
inf = float('inf')
mod = 1000000007
mini = 1000000007

def fact(n):
	if n == 0:
		return 1
	p = 1
	d = 10 ** 9 + 7
	for i in range(1, n + 1):
		p = p * i
		p = p % d
	return p

def ncr(n, r):
	d = 10 ** 9 + 7
	num = fact(n)
	den = fact(r) * fact(n - r) % d
	den = pow(den, d - 2, d)
	return num * den % d

def sieve(n):
	prime = [True for i in range(n + 1)]
	lst = [0] * (n + 1)
	p = 2
	while p * p <= n:
		if prime[p]:
			lst[p] = p
			for i in range(p * p, n + 1, p):
				if prime[i] == True:
					prime[i] = False
					lst[i] = p
		p = p + 1
	for i in range(1, n + 1):
		if lst[i] == 0:
			lst[i] = i
	mylist = [0] * (n + 1)
	for i in range(2, n + 1):
		mylist[lst[i]] = mylist[lst[i]] + 1
	return mylist

def binary(number):
	result = 0
	while number:
		result = result + 1
		number = number & number - 1
	return result

def calculate_factors(n):
	hh = [1] * (n + 1)
	p = 2
	while p * p < n:
		if hh[p] == 1:
			for i in range(p * 2, n, p):
				hh[i] = 0
		p += 1
	total = 1
	for p in range(2, n + 1):
		if hh[p] == 1:
			count = 0
			if n % p == 0:
				while n % p == 0:
					n = int(n / p)
					count += 1
				total *= count + 1
	return total

def prime_factors(n):
	i = 2
	factors = set()
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.add(i)
	if n > 1:
		factors.add(n)
	if len(factors) == 2:
		return True
	else:
		return False

def isPrime(n):
	if n == 2 or n == 3:
		return True
	if n % 2 == 0 or n < 2:
		return False
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
string = input()
count = 0
for i in range(n - 2):
	if string[i] + string[i + 1] + string[i + 2] == 'xxx':
		count = count + 1
print(count)


n = int(input())
file = input()
count = 0
for f in range(n - 2):
	if file[f] == 'x' and file[f + 1] == 'x' and (file[f + 2] == 'x'):
		count += 1
print(count)


n = int(input())
f = input()
while f.count('xxx') > 0:
	f = f.replace('xxx', 'xx')
print(n - len(f))


length = int(input())
string = str(input())
removed = int(0)
for i in range(0, length - 2):
	if string[i] == 'x':
		if string[i] == string[i + 1] and string[i + 1] == string[i + 2]:
			removed += 1
print(removed)


n = int(input())
s = input() + '#'
res = 0
p = 0
for (i, c) in enumerate(s):
	if c == 'x':
		p += 1
	else:
		res += max(0, p - 2)
		p = 0
print(res)


input()
stt = input()
remcount = 0
buff = 0
for i in stt:
	if i == 'x':
		buff += 1
		if buff >= 3:
			remcount += 1
	else:
		buff = 0
print(remcount)


n = int(input())
st = input()
ans = 0
pos = st.find('xxx')
ans = 0
if pos == -1:
	print(0)
else:
	while pos != -1:
		ans += 1
		st = st[:pos] + st[pos + 1:]
		pos = st.find('xxx')
	print(ans)


test = int(input())
string = input()
c = count = 0
for i in string:
	if i == 'x':
		c += 1
	else:
		if c >= 3:
			count += c - 2
		c = 0
if c >= 3:
	count += c - 2
print(count)


import math
a = int(input())
s = str(input())
k = 0
m = 0
for i in range(0, a):
	if s[i] == 'x':
		k = k + 1
		if k > 2:
			m = m + 1
	if s[i] != 'x':
		k = 0
print(m)


N = int(input())
string = input()
i = 0
count = 0
while i < N:
	if string[i:i + 3] == 'xxx':
		string = string[:i] + string[i + 1:]
		count += 1
	else:
		i += 1
print(count)


length = int(input())
name = list(input())
x = 0
total = 0
for i in range(0, length):
	if name[i] == 'x':
		x = x + 1
	else:
		x = 0
	if x >= 3:
		total = total + 1
print(total)


length = int(input())
title = list(input())
total_num_of_x_to_delete = 0
current_num_of_x = 0
current_index = 0
while current_index < length:
	if title[current_index] == 'x':
		current_num_of_x += 1
	else:
		if current_num_of_x >= 3:
			total_num_of_x_to_delete += current_num_of_x - 2
		current_num_of_x = 0
	current_index += 1
if current_num_of_x > 2:
	total_num_of_x_to_delete += current_num_of_x - 2
print(total_num_of_x_to_delete)


import re
n = int(input())
str = input()
count = 0
while str.rfind('xxx', 0, len(str)) != -1:
	pos = str.rfind('xxx', 0, len(str))
	str = str[:pos] + str[pos + 1:]
	count += 1
print(count)


n = int(input())
s = input()
numero = 0
resultado = 0
for c in s:
	if c == 'x':
		numero += 1
		if numero == 3:
			resultado += 1
			numero -= 1
	else:
		numero = 0
print(resultado)


n = int(input())
a = input()
count = 0
ans = 0
for i in a:
	if i == 'x':
		count += 1
		if count >= 3:
			ans += 1
	else:
		count = 0
print(ans)


from math import ceil, log, floor, sqrt
import math
k = 1

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def is_prime(n):
	m = 2
	while m * m <= n:
		if n % m == 0:
			return False
		m += 1
	return True

def find_sum(n, a):
	a.insert(0, 0)
	for i in range(1, n + 1):
		prev = a[i] & a[i - 1]
		cur = a[i] | a[i - 1]
		a[i - 1] = prev
		a[i] = cur
	return sum((m * m for m in a))

def prin_abc(x, y, z):
	l = [x, y, z]
	l.sort()
	if l[1] < l[2]:
		print('NO')
		return
	a = b = l[0]
	c = l[2]
	print('YES')
	print(a, b, c)

def get_scores(n, vals):
	l = 0
	r = n - 1
	turn = 0
	sereja = 0
	dima = 0
	while l <= r:
		if vals[l] > vals[r]:
			cur = vals[l]
			l += 1
		else:
			cur = vals[r]
			r -= 1
		if turn == 0:
			sereja += cur
		else:
			dima += cur
		turn = not turn
	print(sereja, dima)

def count_lamps(n, m):
	return (n * m + 1) // 2

def count_moves(n, name):
	mvs = 0
	cnt = 0
	for i in range(n):
		if name[i] == 'x':
			cnt += 1
		else:
			mvs += max(0, cnt - 2)
			cnt = 0
	mvs += max(0, cnt - 2)
	return mvs
t = 1
while t:
	t = t - 1
	points = []
	n = int(input())
	name = input()
	print(count_moves(n, name))


n = int(input())
s = input()
x = 0
rm = 0
for k in s:
	if k == 'x':
		if x < 2:
			x += 1
		else:
			rm += 1
	else:
		x = 0
print(rm)


n = int(input())
a = list(input())
i = 0
count = 0
while i < len(a):
	if len(a) < 3:
		break
	if i + 2 >= len(a):
		break
	if a[i] == 'x':
		if a[i + 1] == 'x':
			if a[i + 2] == 'x':
				count += 1
	i += 1
print(count)


a = int(input())
b = input()
count = 0
for x in range(0, len(b) - 2):
	if 'xxx' in b[x:x + 3]:
		count += 1
print(count)


n = int(input())
s = input()
v = []
ans = num = 0
for i in range(n):
	if s[i] == 'x':
		num += 1
	else:
		v.append(num)
		num = 0
if num:
	v.append(num)
for i in v:
	ans += max(0, i - 2)
print(ans)


def file(s):
	c = 0
	for i in range(len(s) - 2):
		if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
			c += 1
	print(c)
q = int(input())
s = input()
file(s)


def func(st):
	cnt = 0
	for i in range(len(st)):
		if st[i:i + 3] == 'xxx':
			cnt += 1
	return cnt
n = int(input())
st = input()
print(func(st))


n = int(input())
ans = 0
string = input()
temp = 0
for i in range(0, n):
	if string[i] == 'x':
		temp += 1
		if temp > 2:
			ans += 1
	else:
		temp = 0
print(ans)


n = int(input())
str1 = input()
x = 'xxx'
while 1:
	if x in str1:
		str1 = str1.replace('xxx', 'xx')
	if x not in str1:
		break
print(n - len(str1))


from collections import Counter
n = int(input())
s = input()
count = 0
l = []
p = 0
for i in range(n):
	if s[i] != 'x':
		l.append(p)
		count = 0
	else:
		count += 1
		if count >= 3:
			p += 1
print(p)


n = int(input())
s = str(input())
answer = 0
for i in range(n - 2):
	if s[i] + s[i + 1] + s[i + 2] == 'xxx':
		answer += 1
print(answer)


t = int(input())
k = 0
ch = 0
for i in list(input()):
	if i == 'x':
		ch += 1
	else:
		k += max(0, ch - 2)
		ch = 0
k += max(0, ch - 2)
print(k)


import re
n = input()
s = re.findall('x{3,}', input())
t = 0
for i in s:
	t += len(i) - 2
print(t)


d = int(input())
a = input()
a1 = a
s = 'xxx'
for x in range(d):
	if a[x] != 'x':
		a = a.replace(a[x], '*')
a = a.split('*')
count = 0
for x in a:
	if len(x) > 2:
		count += len(x) - 2
print(count)


n = int(input())
filename = input()
chainlen = 0
result = 0
for i in range(len(filename)):
	if filename[i] == 'x':
		chainlen += 1
	else:
		if chainlen > 2:
			result += chainlen - 2
		chainlen = 0
if chainlen > 2:
	result += chainlen - 2
print(result)


N = int(input())
S = input()
C = 0
for index in range(N - 2):
	if S[index:index + 3] == 'xxx':
		C += 1
print(C)


n = int(input())
s = input()
e = []
k = 0
for i in range(n):
	if s[i] != 'x':
		if k > 2:
			e.append(k)
		k = 0
	else:
		k += 1
if k != 0 and k > 2:
	e.append(k)
print(sum(e) - 2 * len(e))


a = int(input())
b = input()
cnt = 0
for i in range(a - 2):
	if b[i] == b[i + 1] == b[i + 2] == 'x':
		cnt += 1
print(cnt)


l = int(input())
s = input()
subxcount = removals = 0
i = 0
while i < l:
	if s[i] == 'x':
		subxcount += 1
	else:
		if subxcount > 2:
			removals += subxcount - 2
		subxcount = 0
	i += 1
if subxcount > 2:
	removals += subxcount - 2
print(removals)


n = int(input())
a = input()
y = 0
for i in range(2, n):
	if a[i] == 'x' and a[i - 1] == 'x' and (a[i - 2] == 'x'):
		y += 1
print(y)


def main():
	_ = int(input())
	S = input()
	ans = 0
	cur_len = 0
	for s in S:
		if s == 'x':
			cur_len += 1
		else:
			ans += max(0, cur_len - 2)
			cur_len = 0
	ans += max(0, cur_len - 2)
	print(ans)
main()


n = int(input())
k = input()
c = 0
for i in range(n - 2):
	if k[i] == k[i + 1] == k[i + 2] == 'x':
		c += 1
print(c)


n = int(input())
l = input()
x = 'xxx'
c = 0
for i in range(0, len(l) - 2):
	if l[i:i + 3] == x:
		c += 1
print(c)


n = int(input())
s = input()
if s.count('xxx') == 0:
	print('0')
elif s.count('xxx') == 1 and s.count('x') == 3:
	print('1')
else:
	c = 0
	d = 0
	for i in range(n - 1):
		if s[i] == s[i + 1] == 'x' and i != n - 2:
			c += 1
		elif s[i] == 'x' and s[i + 1] != 'x':
			c += 1
			if c > 0 and c > 2:
				d += c - 2
			c = 0
		elif s[i] == s[i + 1] == 'x' and i == n - 2:
			c += 2
		else:
			if c > 0 and c > 2:
				d += c - 2
			c = 0
	if c > 0:
		d += c - 2
	if d == 0 and 'x' not in s:
		print(d)
	elif d == 0 and 'x' in s:
		print(c - 2)
	else:
		print(d)


q = int(input())
stones = list(input())
count = 0
for i in range(2, len(stones)):
	if stones[i] == 'x':
		if stones[i] == stones[i - 1] and stones[i] == stones[i - 2]:
			count += 1
print(count)


n = int(input())
inpt_str = input()
x_counter = 0
ans = 0
for i in inpt_str:
	if i != 'x':
		if x_counter > 2:
			ans += x_counter - 2
		x_counter = 0
	else:
		x_counter += 1
if x_counter > 2:
	ans += x_counter - 2
print(ans)


n = int(input())
string = input()
curr_pos = sub_len = 0
length = []
temp = 0
for i in range(n):
	if string[i] == 'x':
		sub_len += 1
	if string[i] != 'x' or i == n - 1:
		length.append(sub_len)
		sub_len = 0
print(sum([i - 2 for i in length if i > 2]))


n = int(input())
l = list(input())
ctr = 1
c = 0
for i in range(0, n - 1):
	if l[i] == 'x' and l[i + 1] == 'x':
		ctr = ctr + 1
		if ctr >= 3:
			c = c + 1
	if l[i] == 'x' and l[i + 1] != 'x':
		ctr = 1
print(c)


n = int(input())
li = input()
r = 0
i = 0
while i < n:
	if li.find('xxx') >= 0:
		k = li.find('xxx')
		li = li[:k] + li[k + 1:]
		r = r + 1
	i = i + 1
print(r)


mod = 1000000007
ssi = lambda : map(int, input().split())
n = int(input())
a = input()
cnt = 0
ans = 0
for i in range(len(a)):
	if a[i] != 'x':
		if cnt > 2:
			ans += cnt - 2
		cnt = 0
	else:
		cnt += 1
if cnt > 2:
	ans += cnt - 2
print(ans)


n = int(input())
a = input()
l1 = list(a)
s = 0
for i in range(len(a) - 2):
	if l1[i] == 'x' and l1[i + 1] == 'x' and (l1[i + 2] == 'x'):
		l1[i] = 'o'
		s = s + 1
print(s)


n = int(input())
s = input()
while True:
	if 'xxx' in s:
		s = s.replace('xxx', 'xx', 1)
	else:
		break
print(n - len(s))


def occurrences(string, sub):
	count = start = 0
	while True:
		start = string.find(sub, start) + 1
		if start > 0:
			count += 1
		else:
			return count
n = int(input())
s = input()
print(occurrences(s, 'xxx'))


n = int(input())
s = input()
count = 0
for i in range(len(s) - 2):
	s_ = s[i:i + 3]
	if s_ == 'xxx':
		count += 1
print(count)


len = input()
str = input()
count = 0
res = 0
new_word = ''
for i in str:
	if i == 'x':
		count += 1
	else:
		count = 0
	if count == 3:
		res += 1
		count = 2
	else:
		new_word += i
print(res)


n = int(input())
s = input()
count = 0
fixcount = 0
for i in range(n):
	if s[i] == 'x':
		count = count + 1
		if count > 2:
			fixcount = fixcount + 1
	else:
		count = 0
print(fixcount)


n = int(input())
a = input()
(l, k) = (len(a), 0)
for i in range(l - 2):
	if a[i] == 'x' and a[i + 1] == 'x' and (a[i + 2] == 'x'):
		k += 1
print(k)


n = int(input())
s = str(input())
f = 0
r = 0
for i in range(n):
	if s[i] != 'x':
		f = 1
		break
if f == 0:
	print(n - 2)
else:
	for j in range(0, n - 2):
		if s[j] == 'x' and s[j + 1] == 'x' and (s[j + 2] == 'x'):
			r = r + 1
	print(r)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
n = ii1()
s = is1()
res = ''
for i in s:
	if len(res) > 1 and res[-1] == res[-2] == i == 'x':
		continue
	else:
		res += i
print(len(s) - len(res))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
from math import *
from itertools import *
from collections import Counter
from bisect import *

def aa():
	return int(input())

def bb():
	return list(map(int, input().split()))

def cc():
	s = input()
	return list(s)

def dd():
	return map(int, input().split())

def koi_coding_sikha_do():
	n = aa()
	s = cc()
	temp = [s[0], s[1]]
	count = 0
	for i in range(2, n):
		if s[i] == 'x':
			if temp[-1] == 'x' and temp[-2] == 'x':
				count += 1
			else:
				temp.append('x')
		else:
			temp.append(s[i])
	print(count)
t = 1
while t:
	koi_coding_sikha_do()
	t -= 1


from itertools import groupby
noe = int(input())
arr = input()
arrg = groupby(arr)
cnt = 0
for (i, v) in arrg:
	curr = ''.join(v)
	currs = list(set(curr))
	if len(currs) == 1 and currs[0] == 'x':
		cnt += max(0, len(curr) - 2)
print(cnt)


n = int(input())
s = input()
if 'xxx' not in s:
	print('0')
	exit(0)
ct = 0
for i in range(n):
	if 'xxx' in s[i:i + 3]:
		ct += 1
print(ct)


n = int(input())
ans = 0
s = input()
i = 0
while i < n - 2:
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		m = i + 3
		while m < n and s[m] == 'x':
			m += 1
		ans += m - i - 2
		i = m
	else:
		i += 1
print(ans)


n = int(input())
a = input()
ans = 0
s = 'xxx'
i = 0
if a == 'xxx':
	print(ans + 1)
else:
	while i + 3 < n:
		if s == a[i:i + 3]:
			a = a[:i + 2] + a[i + 3:]
			i = 0
			ans += 1
		else:
			i += 1
	print(ans)


n = int(input())
name = list(input())
count = 0
flag = 0
for ch in range(n):
	if name[ch] == 'x':
		flag += 1
	elif name[ch] != 'x':
		flag = 0
	if flag >= 3:
		count += 1
print(count)


import re

def main():
	n = int(input())
	str = input()
	if 'xxx' not in str:
		print(0)
	else:
		print(n - len(re.sub('xxx*', 'xx', str)))
main()


string_len = input()
xx_string = input()
count = 0
for i in range(len(xx_string)):
	flag = True
	for j in range(3):
		if flag:
			if j + i < int(string_len) and xx_string[j + i] == 'x':
				flag = True
			else:
				flag = False
	if flag:
		count += 1
print(count)


n = int(input())
b = input()
a = list(b)
nox = a.count('x')
if nox == n:
	print(n - 2)
else:
	res = [i for i in range(len(b)) if b.startswith('xxx', i)]
	print(len(res))


n = int(input())
l = list(input())
while True:
	flag = False
	if len(l) < 3:
		break
	for i in range(len(l) - 3 + 1):
		if 'x' in l[i:i + 3] and len(set(l[i:i + 3])) == 1:
			del l[i]
			flag = True
			break
	if not flag:
		break
print(n - len(l))


def dkwpwn(string):
	done = False
	count = 0
	while not done:
		done = True
		for i in range(len(string) - 2):
			if string[i] == 'x' and string[i + 1] == 'x' and (string[i + 2] == 'x'):
				del string[i]
				done = False
				count += 1
				break
	return count
useless = input()
string = list(input())
print(dkwpwn(string))


n = input()
n = int(n)
file_name = input()
chars_to_remove = 0
for i in range(n - 2):
	if file_name[i] == 'x' and file_name[i + 1] == 'x' and (file_name[i + 2] == 'x'):
		chars_to_remove += 1
print(chars_to_remove)


n = int(input())
s = list(input())
for i in range(n):
	if s[i] != 'x':
		s[i] = '#'
s = ''.join(s)
l = s.split('#')
d = 0
for x in l:
	if x != '' and len(x) > 2:
		d += len(x) - 2
print(d)


n = int(input())
a = input()
while 'xxx' in a:
	a = a.replace('xxx', 'xx')
print(n - len(a))


n = int(input())
s = input()
rs = 0
tmp = 0
for i in s:
	if i == 'x':
		tmp += 1
	elif tmp > 2:
		rs += tmp - 2
		tmp = 0
	else:
		tmp = 0
if tmp > 2:
	rs += tmp - 2
print(rs)


n = int(input())
nb = 0
nbc = 0
s = input()
for e in s:
	if e == 'x':
		nbc += 1
	else:
		if nbc >= 3:
			nb += nbc - 2
		nbc = 0
if nbc >= 3:
	nb += nbc - 2
print(nb)


n = int(input())
stri = input()
ans = 0
for i in range(2, n):
	if (stri[i] == stri[i - 1] and stri[i - 1] == stri[i - 2]) and stri[i] == 'x':
		ans = ans + 1
print(ans)


from sys import stdin, stdout
n = int(stdin.readline())
s = stdin.readline()
arr = [[] for j in range(100)]
j = 0
for i in range(len(s)):
	if s[i] == 'x':
		arr[j].append('x')
	else:
		j += 1
ans = 0
i = 0
while i < len(arr):
	if len(arr[i]) == 0:
		del arr[i]
		i -= 1
	else:
		ans += max(0, len(arr[i]) - 3 + 1)
	i += 1
stdout.write(str(ans) + '\n')


def f(s, n):
	if len(s) <= 2:
		return 0
	for i in range(len(s)):
		if s[i] == 'x':
			if i + 1 < len(s):
				if s[i + 1] == 'x':
					if i + 2 < len(s):
						if s[i + 2] == 'x':
							return 1 + f(s[:i + 2] + s[i + 3:], len(s))
	return 0
n = int(input())
s = str(input())
print(f(s, n))


n_char = int(input())
f_name = str(input())
x_count = 0
flag = False
to_remove = 0
for i in range(n_char):
	if i == n_char - 1 and f_name[i] == 'x':
		x_count += 1
		if x_count == 3:
			flag = True
		if flag:
			to_remove += -(2 - x_count)
	elif f_name[i] == 'x':
		x_count += 1
		if x_count == 3:
			flag = True
	else:
		if flag:
			to_remove += -(2 - x_count)
			flag = False
		x_count = 0
print(to_remove)


a = int(input())
s = input()
if a == 2 or a == 1:
	print(0)
else:
	b = 0
	for i in range(a - 2):
		if s[i] == s[i + 1] == s[i + 2] == 'x':
			b += 1
		else:
			pass
	print(b)


def solve(n, arr):
	while 'xxx' in arr:
		arr = arr.replace('xxx', 'xx')
	print(n - len(arr))

def main():
	inp = int(input())
	arr2 = input()
	solve(inp, arr2)
main()


n = int(input())
s = input()
summ = 0
for i in range(len(s)):
	if s[i:i + 3] == 'xxx':
		summ += 1
print(summ)


def remover(takestr):
	pos = takestr.find('xxx')
	newstr = takestr[:pos] + takestr[pos + 1:]
	return newstr
n = int(input())
mainstr = input()
item = 1
exst = mainstr.count('xxx')
if exst == 0:
	print('0')
else:
	while 1:
		newstr2 = remover(mainstr)
		again = newstr2.count('xxx')
		mainstr = newstr2
		if again != 0:
			item = item + 1
		else:
			break
	print(item)


def main():
	t = int(input())
	(s, r, i) = (input(), 0, 0)
	while i < t:
		if s[i] == 'x':
			(y, c) = (i + 1, 1)
			while True:
				if y >= t:
					break
				if s[y] == 'x':
					c += 1
					if y + 1 < t:
						y += 1
					else:
						break
				else:
					break
			if c > 2:
				r += c - 2
			i += c
		else:
			i += 1
	print(r)
main()


n = int(input())
s = input()
ct = 0
t = s[:]
while t.count('xxx') != 0:
	x = t.find('xxx')
	t = t[:x] + t[x + 1:]
	ct += 1
print(ct)


n = int(input())
st = list(input())
l = []
co = 1
for i in range(n - 1):
	if st[i] == 'x' and st[i + 1] != 'x':
		l.append(co)
		co = 1
	elif st[i] == 'x':
		co += 1
if st[-1] == 'x':
	l.append(co)
su = 0
for i in l:
	if i > 2:
		su += i - 2
print(su)


n = int(input())
s = input()
(l, c, s1) = ([], 0, 0)
for i in range(len(s)):
	if s[i] == 'x':
		c += 1
	else:
		l.append(c)
		c = 0
l.append(c)
for i in l:
	if i >= 3:
		s1 += abs(2 - i)
print(s1)


n = int(input())
s = input()
ans = 0
temp = 0
if 'xxx' not in s:
	print(0)
else:
	for i in range(n):
		if s[i] == 'x':
			temp += 1
		else:
			if temp > 2:
				ans += temp - 2
			temp = 0
	print(max(ans + temp - 2, ans))


nn = int(input())
s = list(str(input()))
ll = []
count = 0
left = 0
right = 0
onecount = 0
for i in range(nn):
	right = i
	if s[i] == 'x':
		onecount = onecount + 1
	elif onecount < 3:
		None
		onecount = 0
	else:
		count = count + onecount - 2
		onecount = 0
if onecount > 2:
	count = count + onecount - 2
	onecount = 0
print(count)


l = int(input())
s = input()[:l]
seq = [0]
for ch in s:
	if ch == 'x':
		seq[-1] += 1
	else:
		seq.append(0)
res = 0
for v in seq:
	res += max(0, v - 2)
print(res)


n = int(input())
string = str(input())
res = []
cntx = 0
for char in string:
	if char == 'x' and cntx < 2:
		res.append(char)
		cntx += 1
	elif char != 'x':
		res.append(char)
		cntx = 0
print(len(string) - len(res))


import re
n = int(input())
s = str(input())
a = re.findall('(x*)?', s)
ans = [max(0, len(x) - 2) for x in a]
print(sum(ans))


n = int(input())
c = 0
s = input()
ns = ''
for i in s:
	if i != 'x':
		ns = ns + ' '
	else:
		ns = ns + i
l = ns.split()
sum = 0
for i in l:
	if len(i) >= 3:
		sum = sum + len(i) - 2
	else:
		sum = sum
print(sum)


a = input()
a = input()
total = 0
current = 0
for el in a:
	if el == 'x':
		current += 1
	else:
		if current > 2:
			total += current - 2
		current = 0
if current > 2:
	total += current - 2
print(total)


number = int(input())
string = input()
(counter, result) = (0, 0)
for i in range(number):
	if string[i] == 'x':
		counter += 1
	else:
		counter = 0
	if counter >= 3:
		result += 1
print(result)


n = int(input())
k = str(input())
count = 0
if k.count('x') < 3 or k.count('xxx') == 0:
	print('0')
else:
	for j in range(len(k) - 2):
		if k[j] == 'x' and k[j + 1] == 'x' and (k[j + 2] == 'x'):
			count = count + 1
	print(count)


n = int(input())
count = 0
cont = 0
l = input()
for i in l:
	if i == 'x':
		cont += 1
		if cont >= 3:
			count += 1
	else:
		cont = 0
print(count)


def solve():
	n = int(input())
	s = input()
	ans = 0
	for i in range(2, n):
		if s[i] == s[i - 1] == s[i - 2] == 'x':
			ans += 1
	print(ans)
solve()


import sys

def rr():
	return sys.stdin.readline().rstrip()

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))

def rrle():
	return (line.rstrip() for line in sys.stdin.readlines())

def rrtl():
	return [tuple(map(int, l.split())) for l in rrle()]
from collections import defaultdict

def mus(d=lambda : 0):
	return defaultdict(lambda : defaultdict(d))

def dd0(d=lambda : 0):
	return defaultdict(d)

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def fltn(a):
	(i for sub in a for i in sub)

def yn(x):
	return 'YES' if x else 'NO'
from itertools import accumulate
from itertools import groupby

def grp(x, key=None):
	return ((i, sum((1 for _ in g))) for (i, g) in groupby(x, key=key))
import math

def rnar():
	return (*rrl(), rrl())

def rn():
	return (*rrl(),)

def dpp(a, b=''):
	print('#| {} |#:^ {} ^:'.format(a, b))
MOD17 = 10 ** 9 + 7

def read():
	return (rri(), rr())
	return (0,)

def solve(n, s):
	ds = 0
	for (item, count) in grp(s):
		if item == 'x':
			ds += max(0, count - 2)
	ans = ds
	return ans
test_count = 1
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	print(result)


n = int(input())
x = input()
c = 0
a = 0
for i in range(0, n):
	if x[i] == 'x':
		a += 1
	else:
		c += max(0, a - 2)
		a = 0
c += max(0, a - 2)
print(c)


n = int(input())
s = input()
met = 0
gau = 0
for i in range(n):
	if s[i] == 'x':
		gau += 1
	else:
		if gau > 2:
			met += gau - 2
		gau = 0
	if i == n - 1:
		if gau > 2:
			met += gau - 2
print(met)


def filename(n, s):
	temp = 0
	for i in range(0, n - 2):
		if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
			temp = temp + 1
	print(temp)
n = int(input())
s = input()
list1 = list(s)
filename(n, list1)


(n, s) = (int(input()), input())
(counter, curr_counter) = (0, 0)
for i in range(n):
	if s[i] == 'x':
		curr_counter += 1
		if curr_counter >= 3:
			counter += 1
	else:
		curr_counter = 0
print(counter)


n = int(input())
string = input()
delete = 0
if 'xxx' not in string:
	print('0')
else:
	while 'xxx' in string:
		string = string.replace('xxx', 'xx', 1)
		delete += 1
	print(delete)


n = int(input())
s = input()
(lent, i, temp) = (len(s), 0, [])
while i < lent:
	count = 0
	while i < lent and s[i] == 'x':
		count += 1
		i += 1
	temp.append(count)
	i += 1
(lentemp, res) = (len(temp), 0)
for i in range(0, lentemp):
	temp[i] -= 2
	if temp[i] > 0:
		res += temp[i]
print(res)


import sys
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
n = int(input())
s = list(input())
d = 0
c = 0
final = 0
for i in range(n):
	if s[i] == 'x' and d == 0:
		d = 1
		c += 1
	elif s[i] == 'x' and d == 1:
		c += 1
	elif s[i] != 'x' and d == 1:
		d = 0
		if c >= 3:
			final += c - 2
		c = 0
if c >= 3:
	final += c - 2
print(final)


a = int(input())
p = input()
j = int(0)
while p.find('xxx') != -1:
	p = p.replace('xxx', 'xx', 1)
	j = j + 1
print(j)


_ = input()
word = input()
max_x = []
current = 0
for char in word:
	if char == 'x':
		current += 1
	else:
		if current >= 3:
			max_x.append(current)
		current = 0
if current >= 3:
	max_x.append(current)
if max_x:
	result = 0
	for item in max_x:
		result += item - 2
	print(result)
else:
	print(0)


n = int(input())
s = input()
res = 0
for i in range(n - 2):
	ss = s[i:i + 3]
	if ss == 'xxx':
		res += 1
print(res)


k = int(input())
text = input()
if 'xxx' not in text:
	print(0)
	quit()
elif text == 'xxx':
	print(1)
	quit()
else:
	i = 0
	count = 0
	while i != len(text) - 2:
		if text[i:i + 3] == 'xxx':
			count += 1
			text = text[:i + 2] + text[i + 3:]
		else:
			i += 1
print(count)


import sys

def pro():
	return sys.stdin.readline().strip()

def rop():
	return map(int, pro().split())

def main():
	(n, a) = (int(pro()), pro())
	print(sum((1 for (o, q) in enumerate(a) if a[o:o + 3] == 'xxx')))
main()


t = int(input())
s = input()
ans = 0
ind = 0
for i in s:
	ind += 1
	if ind <= t:
		try:
			if s[ind] == 'x' and 'x' == s[ind + 1] and (i == 'x'):
				ans += 1
		except:
			pass
print(ans)


input()
a = list(input())
i = 1
c = 0
while i < len(a) - 1:
	if a[i] == 'x' and a[i - 1] == 'x' and (a[i + 1] == 'x'):
		del a[i]
		c += 1
	else:
		i += 1
print(c)


def split(word):
	return [char for char in word]
t = int(input())
s = input()
s = split(s)
remove = 0
for i in range(t - 2):
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		remove += 1
print(remove)


import re

def main():
	lim = int(input())
	s = input()
	count = 0
	while s.count('xxx') != 0:
		val = s.index('xxx')
		s = s[:val] + s[val + 1:]
		count += 1
	print(count)
main()


n = int(input())
content = input()
counter = 0
result = 0
for c in content:
	if c == 'x':
		counter += 1
		if counter == 3:
			result += 1
			counter -= 1
	else:
		counter = 0
print(result)


n = int(input())
s = input()
if s.find('xxx') == -1:
	print(0)
else:
	k = 0
	for i in range(n - 2):
		if s[i:i + 3] == 'xxx':
			k += 1
	print(k)


n = int(input())
s = input()
c = 0
for x in range(len(s)):
	if s[x:3 + x] == 'xxx':
		c += 1
print(c)


n = int(input())
st = input()
n2 = 0
while 'xxx' in st:
	st = st.replace('xxx', 'xx', 1)
	n2 += 1
print(n2)


def solution(s):
	k = 0
	for i in range(len(s)):
		if s[i:].startswith('xxx'):
			k += 1
	return k
n = int(input())
s = input()
print(solution(s))


_ = input()
s = input()
x = False
erase_count = 0
x_count = 0
for c in s:
	if c == 'x':
		x_count += 1
		if x_count > 2:
			erase_count += 1
	else:
		x_count = 0
print(erase_count)


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
n = int(input())
s = input()
from itertools import groupby
ans = 0
s = groupby(s)
for (k, v) in s:
	if k == 'x':
		v = list(v)
		if len(v) > 2:
			ans += len(v) - 2
print(ans)


n = int(input())
s = input()
if 'xxx' not in s:
	print(0)
	exit(0)
else:
	r = 0
	while 'xxx' in s:
		i = s.find('xxx')
		s = s[:i] + s[i + 1:]
		r += 1
print(r)


n = int(input())
a = input()
c = 0
if a.find('xxx') != -1:
	for i in range(0, n - 2):
		x = a[i] + a[i + 1] + a[i + 2]
		if x == 'xxx':
			c = c + 1
	print(c)
else:
	print('0')


n = int(input())
s = input()
t = 0
for i in range(1, n - 1):
	if s[i - 1] == 'x' and s[i] == 'x' and (s[i + 1] == 'x'):
		t += 1
print(t)


input()
(s, ans) = (input(), 0)
for (index, word) in enumerate(s):
	if s[index:index + 3] == 'xxx':
		ans += 1
print(ans)


n = int(input())
s = input()
runs = []
l = 0
ans = 0
for c in s:
	if c == 'x':
		l += 1
	else:
		runs.append(l)
		ans += max(0, l - 2)
		l = 0
ans += max(0, l - 2)
print(ans)


n = input()
s = input()
a = []
for i in range(len(s)):
	a.append(s[i])
i = 2
count = 0
while i != len(a):
	if a[i] == 'x' and a[i] == a[i - 2] and (a[i] == a[i - 1]):
		a.pop(i)
		count += 1
	else:
		i += 1
print(count)


k = int(input())
s = input()
k = 0
while 'xxx' in s:
	s = s.replace('xxx', 'xx', 1)
	k += 1
print(k)


n = int(input())
s = input()
i = 0
c = 0
while i < n:
	if s[i] == 'x':
		for j in range(i, n):
			if s[j] != 'x':
				h = j
				break
		else:
			h = n
		if h - i > 2:
			c += h - i - 2
		i = h + 1
		continue
	i += 1
print(c)


n = int(input())
a = input()
t = 0
tt = 0
for i in range(len(a)):
	if a[i] == 'x':
		t += 1
	elif t >= 3:
		tt = tt + t - 2
		t = 0
	else:
		t = 0
if t >= 3:
	tt = tt + t - 2
print(tt)


t = 1
while t > 0:
	t -= 1
	n = int(input())
	s = input()
	l = list(s)
	cnt = 0
	ans = 0
	if l[0] == 'x':
		cnt += 1
	else:
		cnt = 0
	for i in range(1, n):
		if l[i] == 'x' and l[i - 1] == 'x':
			cnt += 1
		else:
			cnt = 1
		if cnt >= 3:
			ans += 1
	print(ans)


n = input()
s = input()

def solve(s):
	result = 0
	while 'xxx' in s:
		result += 1
		s = s.replace('xxx', 'xx', 1)
	return result
print(solve(s))


t = int(input())
a = input()
count = 0
for i in range(0, t - 2):
	if a[i] == 'x' and a[i + 1] == 'x' and (a[i + 2] == 'x'):
		count += 1
	else:
		pass
print(count)


n = int(input())
s = input()
m = ''
c = 0
for i in s:
	if i == 'x':
		if m == 'xx':
			c += 1
		else:
			m += i
	else:
		m = ''
print(c)


x = int(input())
y = input()
z = int(0)
for i in range(x - 2):
	if y[i] + y[i + 1] + y[i + 2] == 'xxx':
		z += 1
print(z)


n = int(input())
file_name = input()
sum = 0
while 'xxx' in file_name:
	position = file_name.index('xxx')
	current = file_name[0:position] + file_name[position + 1:len(file_name)]
	file_name = current
	sum += 1
print(sum)


l = int(input())
n = input()
c = 0
while 'xxx' in n:
	i = n.index('xxx')
	c = c + 1
	n = n[0:i + 2] + n[i + 3:]
print(c)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	n = int(inp())
	s = inp()
	ans = 0
	cnt = 0
	st = -1
	end = -1
	i = 0
	while i < n:
		if s[i] == 'x':
			st = i
			k = i
			while k + 1 < n and s[k + 1] == 'x':
				k += 1
			if k - st > 1:
				ans += k - st + 1 - 2
			i = k + 1
			continue
		i += 1
	print(ans)
testcase(1)


n = int(input())
s = input()
res = 0
count = 0
for c in s:
	if c == 'x':
		count += 1
	else:
		res += max(0, count - 2)
		count = 0
res += max(0, count - 2)
print(res)


def solve(n, s):
	res = 0
	i = 0
	while i < len(s):
		if s[i] == 'x':
			j = i + 1
			while j < len(s) and s[j] == 'x':
				j += 1
			cnt = j - i - 2
			if cnt > 0:
				res += cnt
			while cnt > 0:
				s.pop(i)
				cnt -= 1
		i += 1
	print(res)
n = int(input())
tmp = input()
s = []
for i in range(n):
	s.append(tmp[i])
solve(n, s)


n = int(input())
s = input()
cnt = 0
for i in range(0, len(s) - 2):
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		cnt += 1
print(cnt)


import sys
from sys import stdin

def main():
	N = int(stdin.readline())
	string = stdin.readline().strip()
	(ans, cont, band) = (0, 0, False)
	for i in range(N):
		if cont == 2:
			if string[i] == 'x':
				ans += 1
			else:
				cont = 0
		elif string[i] == 'x':
			cont += 1
		else:
			cont = 0
	print(ans)
main()


n = int(input())
m = input()
count = 0
j = 0
for i in range(0, n):
	if m[i] == 'x':
		count = count + 1
	elif count >= 3:
		j = count + j - 2
		count = 0
	else:
		count = 0
if count >= 3:
	j = count + j - 2
print(j)


import re
n = int(input())
print(sum(map(lambda x: len(x) - 2, re.findall('x{3,}', input()))))


def compute(arr, n):
	ans = 0
	for i in range(2, n):
		if arr[i] == 'x' and arr[i - 1] == 'x' and (arr[i - 2] == 'x'):
			ans += 1
	return ans
n = int(input())
arr = input()
print(compute(arr, n))


n = input()
s = input()
a = 0
ans = 0
for i in s:
	if i == 'x':
		a += 1
	else:
		a = 0
	if a == 3:
		a -= 1
		ans += 1
print(ans)


n = int(input())
arr = list(input())
count = 0
remove = 0
for i in arr:
	if i == 'x':
		if count >= 2:
			remove += 1
		else:
			count += 1
	else:
		count = 0
print(remove)


n = int(input())
str = input()
cnt = 0
ans = 0
for i in range(n):
	if str[i] == 'x':
		cnt = cnt + 1
	else:
		cnt = 0
	if cnt == 3:
		ans = ans + 1
		cnt = cnt - 1
print(ans)


n = int(input())
file_name = input()
x_length = 0
count = 0
for symbol in file_name:
	if symbol == 'x':
		x_length += 1
	else:
		if x_length - 2 > 0:
			count += x_length - 2
		x_length = 0
if x_length - 2 > 0:
	count += x_length - 2
print(count)


input()
s = input()
if 'xxx' not in s:
	print('0')
else:
	total = 0
	d = s
	q = list(d)
	while 'xxx' in d:
		index = d.index('xxx')
		q[index] = 's'
		total += 1
		d = ''.join(q)
	print(str(total))


from sys import stdin, stdout
n = stdin.readline().rstrip()
str = stdin.readline().rstrip()
ans = 0
x_streak = 0
for c in str:
	if c == 'x':
		x_streak += 1
	else:
		if x_streak > 2:
			ans += x_streak - 2
		x_streak = 0
if x_streak > 2:
	ans += x_streak - 2
print(ans)


a = int(input())
b = input()
while 'xxx' in b:
	b = b.replace('xxx', 'xx')
print(a - len(b))


n = int(input())
st = list(input())
need = 0
i = 0
while i < len(st):
	if st[i] == 'x':
		c = 0
		c += 1
		j = i + 1
		while j < len(st):
			if st[j] != 'x':
				break
			c += 1
			j += 1
		if c > 2:
			need += c - 2
		i = j
	i += 1
print(need)


input()
s = input()
print(sum((1 for i in range(len(s) - 2) if s[i:i + 3] == 'xxx')))


print(int(input()) - len(input().replace('x' * 10, 'xx').replace('x' * 5, 'xx').replace('x' * 5, 'xx').replace('x' * 5, 'xx').replace('x' * 4, 'xx').replace('x' * 3, 'xx')))


n = int(input())
s = input()
total = 0
index = 0
while index < n:
	if s[index] == 'x':
		count = 0
		while index < n and s[index] == 'x':
			count += 1
			index += 1
		total += max(0, count - 2)
	else:
		index += 1
print(total)


t = int(input())
str = input()
c = 0
d = 0
for ch in str:
	if ch == 'x':
		c = c + 1
		if c > 2:
			d = d + 1
	else:
		c = 0
print(d)


n = int(input())
string1 = input()
count = 0
ans = 0
for i in range(len(string1)):
	if string1[i] == 'x':
		if count < 2:
			count += 1
		else:
			ans += 1
	else:
		count = 0
print(ans)


a = int(input(''))
b = str(input(''))
c = list(b)
k = int(0)
num = int(0)
for i in range(0, a):
	if c[i] == 'x':
		num = num + 1
		if num == 3:
			k = k + 1
			num = num - 1
	else:
		num = int(0)
print(k)


n = int(input())
string = input()
count = 0
ans = 0
for s in string:
	if s == 'x':
		count = count + 1
	else:
		if count >= 3:
			ans = ans + count - 2
		count = 0
if count >= 3:
	ans = ans + count - 2
print(ans)


import math
from collections import defaultdict, deque
import bisect
x = int(input())
a = list(input())
c = 0
for i in range(x - 2):
	if a[i] + a[i + 1] + a[i + 2] == 'xxx':
		c += 1
print(c)


n = int(input())
file = input()
remove = 0
index = 0
while 'x' in file[index:]:
	index = file.index('x', index)
	i = 0
	while index + i < n and file[index + i] == 'x':
		i += 1
	if i >= 3:
		remove += i - 2
	index += i
print(remove)


from collections import Counter

def main():
	(n, s) = (int(input()), input())
	x = Counter([s[i:i + 3] for i in range(n - 2)])
	if x['xxx']:
		print(x['xxx'])
	else:
		print(0)
main()


n = int(input())
s = input()
(ans, l) = (0, -2)
for i in range(len(s)):
	if s[i] == 'x':
		l += 1
	else:
		ans += max(0, l)
		l = -2
print(ans + max(0, l))


n = int(input())
s = input()
count = 0
for i in range(len(s)):
	s = 'xx'.join(s.split('xxx'))
print(n - len(s))


def cut(st):
	i = st.find('xxx')
	if i == -1:
		return 0
	else:
		return 1 + cut(st[i + 1:])
n = int(input())
s = input().strip()
print(cut(s))


n = int(input())
s = input()
s = list(s)
cnt = 0
for j in range(1, n - 1):
	if s[j] == s[j - 1] == s[j + 1] == 'x':
		cnt += 1
print(cnt)


size = int(input())
filename = input()
x_sequence = 0
counter = 0
for l in filename:
	if l == 'x':
		x_sequence += 1
	else:
		x_sequence = 0
	if x_sequence >= 3:
		counter += 1
print(counter)


n = int(input())
strInput = input()
forbiddenChar = 'x'
(cpt, toRemove) = (0, 0)
for c in strInput:
	if c == forbiddenChar:
		cpt += 1
	else:
		cpt = 0
	if cpt >= 3:
		toRemove += 1
print(toRemove)


n = int(input())
s = input()
while 'xxx' in s:
	x = s.find('xxx')
	s = s[:x] + s[x:].replace('x', '', 1)
print(n - len(s))


k = int(input())
str = input() + '0'
delet = 0
n = 0
for i in range(k + 1):
	if str[i] == 'x':
		n += 1
	elif n >= 3:
		delet += n - 2
		n = 0
	else:
		n = 0
print(delet)


n = int(input())
l = input()
s = list(l)
k = 'xxx'
count = 0
while k in l:
	if k in l:
		d = ''
		p = l.index(k)
		s = list(l)
		del s[p]
		for i in range(len(s)):
			d = d + s[i]
		count = count + 1
		l = d
print(count)


n = int(input())
s = input()
l = []
i = 0
le = 0
while i < n:
	if s[i] != 'x':
		l.append(max(0, le - 2))
		le = 0
	else:
		le += 1
	i += 1
if s[i - 1] == 'x':
	l.append(max(0, le - 2))
print(sum(l))


x = int(input())
s = [n for n in input()]
z = []
l = 0
xc = 0
for n in range(x):
	if s[n] == 'x':
		xc += 1
	elif s[n] != 'x':
		xc = 0
	if xc >= 3:
		l += 1
print(l)


n = int(input())
s = input()
c = 0
check = 'xxx'
if check not in s:
	print('0')
else:
	while check in s:
		p = s.index(check)
		a = s[:p]
		b = s[p + 1:]
		s = a + b
		c = c + 1
	print(c)


a = int(input())
s = list(input())
b = []
c = []
count = 0
count1 = 0
for i in s:
	if i == 'x':
		count += 1
	else:
		b.append(count)
		count = 0
		count1 = 0
if count1 == 0:
	b.append(count)
count = 0
for i in b:
	if i > 2:
		c.append(i - 2)
print(sum(c))


n = int(input())
k = 3
s = str(input())
cnt = 0
if s.find('xxx') == -1:
	print(0)
else:
	for i in range(n - k + 1):
		substring = s[i:i + k]
		if substring == 'xxx':
			cnt += 1
	print(cnt)


x = int(input())
s = input()
c = 0
k = 0
L = []
for i in s:
	if i == 'x':
		c += 1
	else:
		if c != 0 and c > 2:
			L.append(c - 2)
		c = 0
if s[-1] == 'x' and c > 2:
	L.append(c - 2)
print(sum(L))


length = int(input())
msg = input()
c = 'x'
x_count = 0
x_cur = 0
for char in msg:
	if char == c:
		x_cur += 1
		if x_cur >= 3:
			x_count += 1
	else:
		x_cur = 0
print(x_count)


n = int(input())
file_name = input()
count = 0
temp = 0
for i in range(n):
	if file_name[i] == 'x':
		temp += 1
		if i == n - 1 and temp >= 3:
			count += temp - 2
			break
	else:
		if temp >= 3:
			count += temp - 2
		temp = 0
print(count)


n = int(input())
s = input()
c = 0
l = []
for i in s:
	if i == 'x':
		c += 1
	else:
		if c >= 3:
			l.append(c)
		c = 0
if c >= 3:
	l.append(c)
print(sum(l) - 2 * len(l))


n = int(input())
s = str(input())
count = 0
tot = 0
for i in s:
	if i == 'x':
		count = count + 1
		if count > 2:
			while count > 2:
				tot = tot + 1
				count = count - 1
	if i != 'x':
		count = 0
print(tot)


size = int(input())
line = input()
newLine = ''
res = 0
while 'xxx' in line:
	for i in range(size):
		if line[i:i + 3] == 'xxx':
			line = line[i + 1:]
			size -= 1
			res += 1
			break
print(res)


lenght = int(input())
char = input()
c = 0
for i in range(len(char) - 2):
	if char[i] == 'x' and char[i + 1] == 'x' and (char[i + 2] == 'x'):
		char.replace('xxx', '2')
		c += 1
	else:
		c += 0
print(c)


input()
string = input()
x = 0
b = 0
for c in string:
	if 'x' == c:
		x += 1
		if x >= 3:
			b += 1
	else:
		x = 0
print(b)


from typing import Tuple

def preprocess(n: str, fname: str) -> Tuple[int, str]:
	num = int(n)
	return (num, fname)

def removalofxs(n: int, fname: str) -> int:
	if n != len(fname):
		raise ValueError()
	if len(fname) <= 2:
		return 0
	current = 1
	prev_elem = 0
	next_elem = 2
	removal_cnt = 0
	while next_elem <= len(fname) - 1:
		if fname[current] == fname[prev_elem] == fname[next_elem] == 'x':
			removal_cnt += 1
		next_elem += 1
		current += 1
		prev_elem += 1
	return removal_cnt
n = input('')
fname = input('')
(num, fname) = preprocess(n, fname)
res: int = removalofxs(num, fname)
print(res)


n = int(input())
s = input()
count = 0
if 'xxx' in s:
	flag = True
	while flag:
		s = s.replace('xxx', 'xx', 1)
		count += 1
		if 'xxx' not in s:
			break
else:
	print(0)
if count > 0:
	print(count)


n = int(input())
file_name = input()
chars_to_delete = 0
for i in range(n - 2):
	if file_name[i:i + 3] == 'xxx':
		chars_to_delete += 1
print(chars_to_delete)


n = int(input())
counter = 0
delete = 0
s = input()
for c in s:
	if c == 'x':
		counter += 1
	else:
		delete += max(counter - 2, 0)
		counter = 0
if counter != 0:
	delete += max(counter - 2, 0)
print(delete)


n = int(input())
s = input()
a = 0
b = 0
for i in range(n):
	if a == 2:
		if s[i] == 'x':
			b += 1
		else:
			a = 0
	elif s[i] == 'x':
		a += 1
	else:
		a = 0
print(b)


n = int(input())
a = input()
b = []
ans = 0
c = 0
for i in range(n):
	if a[i] == 'x':
		c += 1
	else:
		b.append(c)
		c = 0
b.append(c)
for i in b:
	if i >= 3:
		ans += i - 2
print(ans)


(_, a) = (input(), input())
print(sum((1 for i in range(len(a) - 2) if a[i:i + 3] == 'xxx')))


n = int(input())
string = str(input())
if 'xxx' in string:
	result = 0
	cnt = 0
	for s in string:
		if s == 'x':
			cnt += 1
			if cnt > 2:
				result += 1
		else:
			cnt = 0
	print(result)
else:
	print(0)


n = input()
input_string = input()
index = 0
delete = 0
while index < len(input_string):
	if index + 1 < len(input_string) and index + 2 < len(input_string) and (input_string[index] == 'x') and (input_string[index + 1] == 'x') and (input_string[index + 2] == 'x'):
		input_string = input_string[:index] + input_string[index + 1:]
		delete += 1
	else:
		index += 1
print(delete)


n = int(input())
s = list(input()) + ['*']
ans = []
c = 0
for i in range(n + 1):
	if s[i] == 'x':
		c += 1
	elif s[i] != 'x' and s[i - 1] == 'x':
		ans.append(c)
		c = 0
l = 0
for i in ans:
	l += max(0, i - 2)
print(l)


s = input()
s = 'o' + input() + 'o'
l = []
cnt = 0
for i in s:
	if i == 'x':
		cnt += 1
	else:
		l.append(cnt)
		cnt = 0
ans = 0
for i in l:
	if i > 2:
		ans = ans + i - 2
print(ans)


n = int(input())
s = input()
xCount = 0
prev = 0
st = ''
for i in s:
	if i == 'x':
		if prev == 1:
			xCount += 1
			if xCount < 2:
				st += str(i)
		else:
			st += str(i)
		prev = 1
	else:
		xCount = 0
		prev = 0
		st += str(i)
print(n - len(st))


n = int(input())
a = input()
i = 0
ans = 0
while i < n:
	j = i
	while i < n and a[i] == 'x':
		i += 1
	if i - j > 2:
		ans += i - j - 2
	i += 1
print(ans)


n = int(input())
user_input = input()
counter = 0
characters_to_delete = 0
user_input_list = []
for char in user_input:
	user_input_list.append(char)
for i in user_input_list:
	if i == 'x':
		counter += 1
	elif i != 'x':
		counter = 0
	if counter >= 3:
		characters_to_delete += 1
if characters_to_delete < 1:
	print(0)
else:
	print(characters_to_delete)


a = input()
s = input()
l = list(s)
m = 0
k = 0
for x in range(len(s)):
	if l[x] == 'x':
		m += 1
	if l[x] != 'x':
		m = 0
	if m > 2:
		k += 1
print(k)


n = int(input())
s = input()
s += '/'
x = 0
delete = 0
for i in s:
	if i == 'x':
		x += 1
	else:
		if x > 2:
			delete += x - 2
		x = 0
print(delete)


strLength = int(input(), 10)
fileName = input()
countOfCharsDeleted = 0
currentCountX = 0
for (i, c) in enumerate(fileName):
	if c == 'x':
		currentCountX += 1
	else:
		if currentCountX >= 3:
			countOfCharsDeleted += currentCountX - 2
		currentCountX = 0
if currentCountX >= 3:
	countOfCharsDeleted += currentCountX - 2
print(countOfCharsDeleted)


trash = input()
file_name = input()
asw = 0
while True:
	founded_index = file_name.find('xxx')
	if founded_index == -1:
		break
	else:
		asw = asw + 1
		file_name = file_name[:founded_index] + file_name[founded_index + 1:]
print(asw)


n = int(input())
s = input()
ns = []
l = 0
for c in s:
	if c != 'x':
		if l != 0:
			ns.append(l)
		l = 0
		continue
	if c == 'x':
		l += 1
if l != 0:
	ns.append(l)
ans = 0
for c in ns:
	ans += max(0, c - 2)
print(ans)


I = input
I()
t = j = 0
for c in I():
	if c == 'x':
		j += 1
	else:
		t += max(0, j - 2)
		j = 0
print(t + max(0, j - 2))


num = int(input())
string = input()
arr = [0] * num
start = 0
counter = 0
for t in range(num):
	if string[t] != 'x':
		arr[counter] = start
		counter += 1
		start = 0
	else:
		start += 1
if string.count('x') == 0:
	print(0)
else:
	arr[counter] = start
	total = 0
	for k in range(num):
		if arr[k] != 0:
			if arr[k] >= 3:
				total = total + (arr[k] - 2)
	print(total)


import sys
data = sys.stdin.readlines()
lis = []
for line in data:
	lis.append(line)

def large(word, ind):
	ctr = 0
	index = 0
	for (i, char) in enumerate(word[ind:]):
		if char != 'x':
			index = ind + i
			break
		else:
			ctr += 1
	if ctr > 2:
		ctr = ctr - 2
	else:
		ctr = 0
	return (index, ctr)
n = int(lis[0])
seq = list(lis[1])
n_rmv = 0
ind = 0
ind = 0
while ind < len(seq):
	if seq[ind] != 'x':
		ind += 1
	else:
		(ind, n1) = large(seq, ind)
		n_rmv += n1
print(n_rmv)


n = input()
a = input()
commoncounter = 0
i = 0
while i < len(a):
	if a[i] == 'x':
		localcounter = 0
		while i < len(a) and a[i] == 'x':
			localcounter += 1
			i += 1
		if localcounter > 2:
			commoncounter += localcounter - 2
	i += 1
print(commoncounter)


i = input()
s = input()
ans = 0
ind = 0
while s.count('xxx') >= 1:
	index = s.find('xxx')
	s = s[:index] + s[index + 1:]
	ind += 1
print(ind)


from sys import stdin

def solve(tc):
	n = int(stdin.readline().strip())
	s = stdin.readline().strip()
	res = []
	cnt = 0
	for i in range(n):
		if s[i] == 'x':
			cnt += 1
		else:
			if cnt >= 3:
				res.append(cnt)
			cnt = 0
	if cnt >= 3:
		res.append(cnt)
	ans = 0
	for i in res:
		ans += i - 2
	print(ans)
LOCAL_TEST = not __debug__
if LOCAL_TEST:
	infile = __file__.split('.')[0] + '-test.in'
	stdin = open(infile, 'r')
tcs = int(stdin.readline().strip()) if LOCAL_TEST else 1
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


n = int(input())
files = list(input())
ans = 0
if n > 2:
	for i in range(0, n - 2):
		if files[i] == 'x' and files[i + 1] == 'x' and (files[i + 2] == 'x'):
			ans += 1
print(ans)


n = int(input())
name = input()
ans = 0
i = 0
while i < n:
	if name[i] == 'x':
		kol = 0
		j = i
		while name[j] == 'x':
			kol += 1
			j += 1
			if j == n:
				break
		if kol >= 3:
			ans += kol - 3 + 1
		i = j
	i = i + 1
print(ans)


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	s = input()
	t = ''
	for i in range(len(s)):
		if len(t) >= 2 and (t[-1] == 'x' and t[-2] == 'x' and (s[i] == 'x')):
			continue
		t += s[i]
	print(len(s) - len(t))
main()


n = int(input())
s = input()
ret = [1 for i in range(n - 2) if s[i:i + 3] == 'xxx']
print(sum(ret))


n = int(input())
file = input() + '&'
count = 0
ans = 0
for i in file:
	if i == 'x':
		count += 1
	elif count != 0:
		ans += max(0, count - 2)
		count = 0
print(ans)


n = int(input())
x = input()
N = 0
for i in range(len(x)):
	if 'xxx' in x[i:i + 3]:
		N += 1
print(N)


n = int(input())
s = input()
c = 0
while s.find('xxx') != -1:
	s = s.replace('xxx', 'xx')
print(n - len(s))


n = int(input())
s = input()
c = 0
x = 0
for i in s:
	if i == 'x' and c < 2:
		c += 1
	elif i == 'x':
		x += 1
	else:
		c = 0
print(x)


tam = int(input())
string = input()
changes = 0
while True:
	index = string.find('xxx')
	if index == -1:
		break
	string = string[:index] + '0' + string[index + 1:]
	changes += 1
print(changes)


len = int(input())
str = input()
substring = 'xxx'
count = 0
while True:
	res = str.find(substring)
	if res == -1:
		break
	else:
		str = str[0:res] + str[res + 1:]
		count += 1
print(count)


n = int(input())
s = input()
c = 0
for i in range(n):
	if s[n - i - 3:n - i] == 'xxx':
		s.lstrip('x')
		c += 1
print(c)


n = int(input())
s = input()
ans = 0
for i in range(n, 2, -1):
	st = 'x' * i
	while s.count(st):
		ans += s.count(st) * (i - 2)
		s = s.replace(st, '')
print(ans)


import re
n = int(input())
filename = input()
x_list = re.findall('x+', filename)
x_replace = 0
for string in x_list:
	if len(string) >= 3:
		x_replace = x_replace + (len(string) - 2)
print(x_replace)


N = input()
S = input()
count = 0
while 'xxx' in S:
	count += 1
	idx = S.index('xxx')
	S = S[:idx] + S[idx + 1:]
print(count)


n = int(input())
mot = input()
c = 0
t = 0
mot_actuel = ''
for x in range(len(mot)):
	a = x
	i = mot[x]
	mot_actuel += i
	if i == 'x':
		c += 1
		if c == 3:
			c = 2
			t += 1
		else:
			mot_actuel += i
	else:
		c = 0
		mot_actuel += i
print(t)


n = int(input())
s = input()
res = 0
(flag1, flag2) = (0, 0)
for i in s:
	if i == 'x' and flag1 < 2:
		flag1 += 1
	elif i == 'x' and flag1 >= 2:
		flag2 += 1
	elif i != 'x':
		flag1 = 0
print(flag2)


n = input()
s = input()
c = 0
while s.count('xxx') > 0:
	s = s[:s.find('xxx') + 2] + s[s.find('xxx') + 3:]
	c += 1
print(c)


n = int(input())
str = input()
n += 1
str += '0'
cnt = 0
R = 0
for i in range(n):
	if str[i] == 'x':
		cnt += 1
	elif cnt != 0:
		R += max(cnt - 2, 0)
		cnt = 0
print(R)


n = int(input().strip())
s = input().strip()
print(sum((1 for i in range(len(s) - 2) if s[i:i + 3] == 'xxx')))


_ = input()
s = input()
cur = 0
total = 0
for i in range(0, len(s)):
	if s[i] == 'x' and s[i] == s[i - 1]:
		cur += 1
	elif s[i] == 'x':
		cur += 1
	else:
		if cur > 2:
			total += cur - 2
		cur = 0
if cur > 2:
	total += cur - 2
print(total)


n = int(input().strip())
str = input()
count = 0
for i in range(n - 3 + 1):
	if str[i:i + 3] == 'xxx':
		count += 1
print(count)


n = int(input())
a = list(input())
res = 0
flag = 0
count = 0
for i in range(n):
	if a[i] != 'x':
		flag = 0
		res += max(count - 2, 0)
		count = 0
	elif a[i] == 'x':
		if flag == 0:
			flag = 1
			count += 1
		elif flag == 1:
			count += 1
res += max(count - 2, 0)
print(res)


n = int(input())
string = input()
for i in range(n):
	if string.count('xxx') == 0:
		break
	string = string.replace('xxx', 'xx')
print(n - len(string))


file = int(input())
file_name = input()
deletes = 0
for x in range(file - 2):
	if file_name[x] == 'x' and file_name[x + 1] == 'x' and (file_name[x + 2] == 'x'):
		deletes += 1
print(deletes)


n = int(input())
s = list(input())
i = 2
c = 0
while i < n:
	if s[i] == s[i - 1] and s[i] == s[i - 2] and (s[i] == 'x'):
		del s[i]
		i = 1
		n -= 1
		c += 1
	i += 1
print(c)


input()
s = input()
x = 0
ans = 0
for c in s:
	if c == 'x':
		if x == 2:
			ans += 1
		else:
			x += 1
	else:
		x = 0
print(ans)


a = int(input())
b = str(input())
s = 0
for i in range(2, len(b)):
	if b[i] == 'x' and b[i - 1] == 'x' and (b[i - 2] == 'x'):
		s += 1
print(s)


input()
r = 0
s = input()
while s.find('xxx') != -1:
	s = s.replace('xxx', 'xx', 1)
	r = r + 1
print(r)


import sys
import math
import bisect

def main():
	n = int(input())
	s = input()
	val = 0
	A = []
	for i in range(n):
		if s[i] == 'x':
			val += 1
		else:
			val = 0
		if s[i] == 'x':
			if i == n - 1 or s[i + 1] != 'x':
				A.append(val)
	ans = 0
	for a in A:
		if a > 2:
			ans += a - 2
	print(ans)
main()


def rec(b):
	if len(b) < 3:
		return 0
	if b[0:3] == 'xxx':
		return 1 + rec(b[1:])
	else:
		return 0 + rec(b[1:])
a = int(input())
b = str(input())
print(rec(b))


n = int(input())
m = input()
x = 0
l = []
for i in m:
	if i == 'x':
		x += 1
	if i != 'x':
		l.append(x)
		x = 0
else:
	l.append(x)
y = max(l)
ans = 0
for i in l:
	if i >= 3:
		ans += i - 2
if y <= 2:
	print(0)
else:
	print(ans)


n = int(input())
a = list(input()) + [' ']
arr = counter = 0
for item in a:
	if item == 'x':
		counter += 1
	else:
		arr += max(0, counter - 2)
		counter = 0
print(arr)


n = int(input())
string = input()
index = 0
mass = ['a'] * n
xses = 0
resalt = 0
for i in range(n):
	mass[i] = string[i]
while len(mass) > index:
	if mass[index] == 'x' or mass[index] == 'х':
		xses += 1
	else:
		xses = 0
	if xses == 3:
		mass.pop(index)
		index -= 1
		resalt += 1
		xses -= 1
	index += 1
print(resalt)


n = int(input())
s = input()
del_count = 0
for i in range(n):
	if 'xxx' in s:
		s = s.replace('xxx', 'xx', 1)
		del_count += 1
print(del_count)


n = int(input())
filename = str(input())
xcount = 0
xremove = 0
for c in filename:
	if c == 'x':
		xcount += 1
	else:
		if xcount > 2:
			xremove += xcount - 2
		xcount = 0
if xcount > 2:
	xremove += xcount - 2
print(xremove)


num = int(input())
s = input()
count = 0
while True:
	temp = s.find('xxx')
	if temp == -1:
		break
	l = list(s)
	l.pop(temp)
	count += 1
	s = ''.join(l)
print(count)


n = int(input())
a = input()
a = list(a)
ind = []
f = 0
for i in range(n - 2):
	if a[i:i + 3] == ['x', 'x', 'x']:
		f += 1
print(f)


n = int(input())
s = input()
lst = []
k = 0
for x in range(n):
	if s[x] == 'x':
		k += 1
	else:
		if k != 0:
			lst.append(k)
		k = 0
if k != 0:
	lst.append(k)
ans = 0
for x in lst:
	if x >= 3:
		ans += x - 2
print(ans)


input()
s = input()
ans = 0
for i in range(150, 2, -1):
	t = 'x' * i
	if t in s:
		ans += (i - 2) * s.count(t)
		s = s.replace(t, 'xx')
print(ans)


def secret_file(s):
	(count, summa) = (0, 0)
	for i in range(len(s)):
		if s[i] == 'x':
			count += 1
		else:
			summa += max(count - 2, 0)
			count = 0
	return summa + max(count - 2, 0)
n = int(input())
s = input()
print(secret_file(s))


n = int(input())
s = input()
s1 = s[0:2]
for i in range(2, n):
	if s1[-1:-3:-1] == 'xx' and s[i] == 'x':
		pass
	else:
		s1 = s1 + s[i]
print(len(s) - len(s1))


(n, cnt, ans) = (int(input()), 0, 0)
s = input()
for x in s:
	if x == 'x':
		if cnt < 2:
			cnt += 1
		else:
			ans += 1
	else:
		cnt = 0
print(ans)


_ = input()
l = input()
res = 0
for i in range(len(l) - 2):
	if l[i] == l[i + 1] and l[i + 1] == l[i + 2] and (l[i] == 'x'):
		res += 1
print(res)


input()
g = str(input())
c = 0
for i in range(len(g)):
	if g[i:i + 3] == 'xxx':
		c += 1
print(c)


n = int(input())
l = input()
c = 0
i = n
while i > 2:
	st = i * 'x'
	if st in l:
		p = l.count(st)
		l = l.replace(st, '')
		c += (i - 2) * p
	i -= 1
print(c)


input()
n = input()
counter = 0
while True:
	if n.count('xxx') > 0:
		n = n.replace('xxx', 'xx', 1)
		counter += 1
	else:
		break
print(counter)


n = int(input())
s = input()
if s.find('xxx') == -1:
	print('0')
else:
	count = 0
	while s.find('xxx') != -1:
		s = s.replace('xxx', 'xx', 1)
		count += 1
	print(count)


import sys
input = lambda : sys.stdin.readline().strip()
n = int(input())
s = input()
lens = []
for i in range(len(s)):
	if s[i] == 'x':
		if i > 0 and s[i - 1] == 'x':
			lens[-1] += 1
		else:
			lens.append(1)
print(sum((max(0, l - 2) for l in lens)))


from sys import stdin

def main():
	n = int(stdin.readline())
	(cnt, ans) = (0, 0)
	l = stdin.readline()
	x = 'x'
	i = 0
	while i < len(l) - 1:
		if l[i] == x and cnt < 2:
			cnt += 1
		if l[i] != x:
			cnt = 0
		if cnt == 2 and l[i + 1] == x:
			ans += 1
		if cnt == 2 and l[i] != x:
			cnt = 0
		i += 1
	print(ans)
main()


n = int(input())
s = input()
streak = 0
cnt = 0
for ch in s:
	if ch != 'x':
		streak = 0
	elif streak < 2:
		streak += 1
	else:
		cnt += 1
print(cnt)


n = int(input())
s = input()
count = 0
g = ''
for x in range(0, n - 2):
	g = s[x:x + 3]
	if g == 'xxx':
		count = count + 1
print(count)


n = input()
s = input()
b = 0
res = 0
for c in s:
	if c == 'x':
		b = b + 1
	else:
		b = 0
	if b >= 3:
		res = res + 1
print(res)


c = input()
name = input()
cnt = 0
res = 0
for c in name:
	if c == 'x':
		cnt += 1
		if cnt > 2:
			res += 1
	else:
		cnt = 0
print(res)


a = int(input())
b = input()
r = 0
for i in range(0, a - 2, 1):
	if b[i:i + 3] == 'xxx':
		r += 1
print(r)


n = input()
s = input()
sol = 0
while 'xxx' in s:
	sol += 1
	index = s.find('xxx')
	s = s[:index] + s[index + 1:]
print(sol)


n = int(input())
String = input()
rejectedSub = 'xxx'
removeCount = 0
for i in range(n):
	if rejectedSub in String[i:i + 3]:
		removeCount += 1
print(removeCount)


n = int(input())
a = input()
c = 0
answer = 0
for i in a:
	if i == 'x':
		c += 1
		if c > 2:
			answer += 1
	else:
		c = 0
print(answer)


n = int(input())
string = input()

def remove_x(inp, count=0):
	try:
		index = inp.index('xxx')
		inp = list(inp)
		del inp[index]
		count += 1
		return remove_x(''.join(inp), count)
	except ValueError:
		return count
n = remove_x(string)
print(n)


n = input()
x = input()
l = list(x)
c = 0
d = 0
for i in l:
	if i == 'x':
		c += 1
	else:
		if c >= 3:
			d = d + c - 2
		c = 0
if c >= 3:
	d = d + c - 2
	c = 0
print(d)


import re
n = int(input())
txt = input()
x = re.sub('xxx+', 'xx', txt)
print(n - len(x))


n = int(input())
c = 0
s = input()
for i in range(0, len(s) - 2):
	for j in range(i + 1, i + 2):
		for k in range(j + 1, j + 2):
			if s[i] == 'x' and s[j] == 'x' and (s[k] == 'x'):
				c = c + 1
print(c)


n = int(input())
s = str(input())
to_remove = 0
for i in range(n):
	if i + 2 <= n - 1:
		if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
			to_remove += 1
	else:
		break
print(to_remove)


import math
import sys
import itertools
import itertools

def sa(Type=int):
	return [Type(x) for x in input().split()]

def solve(t):
	n = int(input())
	s = input()
	cc = 0
	inXBlock = False
	prev = ' '
	xLen = 0
	for ch in s:
		inXBlock = ch == 'x'
		if not inXBlock:
			xLen = 0
		else:
			xLen += 1
		if xLen > 2:
			cc += 1
		prv = ch
	print(cc)
solve(0)


n = int(input())
s = input().strip()
tot = 0
c = 0
for ch in s:
	if ch == 'x':
		c += 1
		if c >= 3:
			tot += 1
			c = 2
	else:
		c = 0
print(tot)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
(amount, name, i, count) = (int(f_input()), f_input(), 0, 0)
while i < amount:
	if name[i] != 'x':
		i += 1
		continue
	if i > 1 and name[i - 2] == 'x' and (name[i - 1] == 'x'):
		count += 1
	i += 1
f_print(str(count))


n = int(input())
l = list(input())
count = 0
ans = 0
uk2 = 0
uk1 = 0
for i in range(n):
	if l[i] == 'x':
		count += 1
	else:
		count = 0
	if count >= 3:
		ans += 1
print(ans)


t = int(input())
t = 1
while t:
	t = t - 1
	c = 0
	st = []
	s = input().strip()
	for i in s:
		if i == 'x':
			st.append(i)
		elif i != 'x':
			if len(st) > 2:
				c = c + len(st) - 2
			st = []
	if len(st) > 2:
		c = c + len(st) - 2
	print(c)


n = int(input())
string = str(input())
count = 0
for i in range(len(string) - 2):
	substring = string[i:i + 3]
	if 'xxx' in substring:
		count += 1
print(count)


n = int(input())
s = input()
k = 0
p = 0
for i in s:
	if i == 'x':
		p += 1
	else:
		p = 0
	if p >= 3:
		k += 1
print(k)


n = int(input())
a = str(input())
cur = 0
cnt = 0
for e in a:
	if e == 'x':
		if cur == 2:
			cnt += 1
		else:
			cur += 1
	else:
		cur = 0
print(cnt)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	s = S()
	c = 0
	r = 0
	for t in s:
		if t == 'x':
			if c == 2:
				r += 1
			else:
				c += 1
		else:
			c = 0
	return r
print(main())


n = int(input())
str1 = input()
count = 0
for y in range(n - 2):
	if str1[y] == 'x' and str1[y + 1] == 'x' and (str1[y + 2] == 'x'):
		count += 1
print(count)


n = int(input())
s = input()
i = 0
l = 0
out = 0
while i < n:
	if s[i] == 'x':
		l += 1
	else:
		if l > 2:
			out += l - 2
		l = 0
	i += 1
if l > 2:
	out += l - 2
l = 0
print(out)


import sys
n = int(input())
file_name = input()
to_remove = 0
xxx_length = 0
for c in file_name:
	if c == 'x':
		xxx_length += 1
	else:
		if xxx_length >= 3:
			to_remove += xxx_length - 2
		xxx_length = 0
if xxx_length >= 3:
	to_remove += xxx_length - 2
print(to_remove)


n = input()
n = int(n)
s = input()
y = 0
for i in range(100):
	if s.find('xxx') == -1:
		print(y)
		break
	else:
		s1 = list(s)
		del s1[s.find('xxx')]
		y += 1
		s = ''.join(s1)


n = int(input())
s = input()
max_x_count = 0
x_count = 0
store_x = 0
for i in s:
	if i == 'x':
		x_count += 1
		store_x = x_count
	else:
		if x_count >= 3:
			max_x_count += x_count - 2
			store_x = 0
		x_count = 0
if x_count == len(s):
	print(x_count - 2)
elif store_x >= 3:
	print(max_x_count + store_x - 2)
else:
	print(max_x_count)


n = int(input())
s = input()
count = 0
while 'xxx' in s:
	ind = s.index('xxx')
	s = s[:ind] + s[ind + 1:]
	count += 1
print(count)


a = int(input())
b = str(input())
b = b + 'aaa'
c = 0
import math
for i in range(0, a):
	if b[i] == 'x' and b[i + 1] == 'x' and (b[i + 2] == 'x'):
		c += 1
print(c)


def solve():
	n = int(input())
	stri = input()
	check = False
	first_x = False
	second_x = False
	index_to_be_removed = 0
	for char in stri:
		if char == 'x' and (not first_x):
			first_x = True
		elif char == 'x' and first_x and (not second_x):
			second_x = True
		elif char == 'x' and first_x and second_x:
			index_to_be_removed += 1
		else:
			first_x = False
			second_x = False
	return index_to_be_removed
ans = solve()
print(ans)


n = int(input())
s = str(input())
for i in range(n):
	if 'xxx' in s:
		s = s.replace('xxx', 'xx')
print(n - len(s))


N = int(input())
file = input()
remove = 0
x_count = 0
for i in range(N):
	if file[i] != 'x':
		x_count = 0
	if file[i] == 'x':
		x_count += 1
	if x_count > 2:
		remove += 1
print(remove)


n = int(input())
s = input()
x = []
st = ''
for i in s:
	if i == 'x':
		st += i
	elif len(st) >= 3:
		x.append(st)
		st = ''
	else:
		st = ''
if len(st) >= 3:
	x.append(st)
count = 0
if len(x) == 0:
	print(0)
else:
	for i in x:
		count = count + (len(i) - 2)
	print(count)


n = int(input())
S = 'o' + input() + 'o'
u = 1
U = []
a = 0
for i in range(n + 1):
	if S[i] == S[i + 1] == 'x':
		u += 1
	else:
		U.append(u)
		u = 1
for i in U:
	if i > 2:
		a += i - 2
print(a)


def main():
	n = int(input())
	s = input()
	count = 0
	i = 0
	while i < n - 2:
		if s[i] == 'x' and s[i + 1] == 'x':
			if s[i + 2] == 'x':
				count += 1
		i += 1
	print(count)
main()


n = int(input())
s = input() + '_'
s_ = 0
c = 0
for i in s:
	if i == 'x':
		c += 1
	else:
		if c > 2:
			s_ += c - 2
		c = 0
print(s_)


l = input()
s = input()
n = 0
m = 0
for i in range(len(s)):
	if s[i] == 'x':
		n += 1
	else:
		if n > 2:
			m += n - 2
		n = 0
if n > 2:
	m += n - 2
print(m)


t = int(input())
s = str(input())
initial = s.count('x')
for i in s:
	if 'xxx' in s:
		s = s.replace('xxx', 'xx')
		n = s.count('x')
		if n > 2:
			continue
		else:
			break
x = s.count('x')
print(initial - x)


lenght = int(input())
string = input()
arr = []
for i in range(0, len(string)):
	arr.append(string[i])
counter = 0
out = 0
i = 0
while i < len(arr):
	if arr[i] == 'x':
		counter += 1
	else:
		counter = 0
	if counter == 3:
		out += 1
		arr.pop(i)
		counter = 0
		i = 0
	else:
		i += 1
print(out)


(n, string, remov) = (int(input()), input(), 0)
while 'xxx' in string:
	(string, remov) = (string[:string.index('xxx')] + string[string.index('xxx') + 1:], remov + 1)
print(remov)


nums = input()
word = input()

def do():
	if 'xxx' not in word:
		print('0')
		return
	found = word
	counter = 0
	x = found.find('xxx')
	while x >= 0:
		counter += 1
		ls = list(found)
		ls.pop(x)
		found = ''.join(ls)
		x = found.find('xxx')
	print(counter)
do()


n = int(input())
s = str(input())
ans = 0
cur = s[0]
cnt = 0
X = []
for i in range(n):
	if s[i] == cur:
		cnt += 1
	else:
		if cur == 'x':
			X.append(cnt)
		cur = s[i]
		cnt = 1
else:
	if cur == 'x':
		X.append(cnt)
for x in X:
	if x > 2:
		ans += x - 2
print(ans)


def main():
	n = int(input())
	s = input()
	pos = 0
	res = 0
	while pos < n - 2:
		if s[pos] == s[pos + 1] == s[pos + 2] == 'x':
			res += 1
			pos += 1
		else:
			pos += 1
	print(res)
main()


length = int(input())
s = input().strip()
assert len(s) == length
s += 'a'
result = 0
end = None
count = None
for c in s:
	if count == None and c == 'x':
		count = 1
	elif count != None:
		if c == 'x':
			count += 1
		else:
			if count > 2:
				result += count - 2
			count = None
print(result)


input()
s = input()
k = 0
while 'xxx' in s:
	k += 1
	i = s.index('xxx')
	s = s[:i] + s[i + 1:]
print(k)


import sys

def read_from_stdin():
	N = input()
	s = input()
	return s

def write_to_stdout(res):
	sys.stdout.write('%d\n' % res)

def get_answer(s):
	count = 0
	idx = s.find('xxx')
	while idx != -1:
		s = s[:idx] + s[idx + 1:]
		idx = s.find('xxx')
		count += 1
	return count

def main():
	s = read_from_stdin()
	write_to_stdout(get_answer(s))
main()


input()
s = input()
a = 0
while 'xxx' in s:
	s = s.replace('xxx', 'xx', 1)
	a += 1
print(a)


n = int(input())
count = 0
line = input()
while 'xxx' in line:
	new = ''
	k = 0
	for i in range(len(line)):
		if line[i] == 'x':
			k += 1
			if k <= 2:
				new += line[i]
		else:
			if k > 2:
				count += k - 2
			new += line[i]
			k = 0
	if k > 2:
		count += k - 2
	line = ''
	for i in new:
		line += i
print(count)


number = int(input())
text = input()
text_arr = []
counter = 0
x_counter = 0
for i in range(number):
	text_arr.append(text[i])
for item in text_arr:
	if item == 'x':
		counter += 1
	elif item != 'x':
		counter = 0
	if counter == 3:
		x_counter += 1
		counter -= 1
print(x_counter)


input()
string = input()
x_current = 0
x_total = 0
for char in string:
	if char == 'x':
		x_current += 1
	else:
		x_current = 0
	if x_current > 2:
		x_total += 1
print(x_total)


n = int(input())
a = input()
s = 0
for x in range(n - 2):
	if a[x] == 'x' and a[x + 1] == a[x + 2] == 'x':
		s += 1
print(s)


n = int(input())
filename = input()
kol = 0
for i in range(0, n - 2):
	if filename[i] == 'x' and filename[i + 1] == 'x' and (filename[i + 2] == 'x'):
		kol += 1
print(kol)


n = int(input())
s = input()
q = 0
while 'xxx' in s:
	for i in range(n - 2):
		if s[i:i + 3] == 'xxx':
			s = s[:i] + s[i + 1:]
			q += 1
print(q)


x = input()
s = input()

def first(s, c):
	for x in range(len(s)):
		if s[x] != c:
			return x
count = 0
while s:
	if not len(list(filter(lambda x: x == 'x', s))) == len(s) and 'x' in s:
		index = first(s, 'x')
		if len(s[:index]) >= 3:
			count += len(s[:index]) - 2
		try:
			s = s[index + 1:]
		except ValueError:
			pass
	elif 'x' in s:
		if len(s) >= 3:
			count += len(s) - 2
		s = None
	else:
		s = None
print(count)


x = int(input())
y = list(input())
v = 0
if len(y) > 2:
	for i in range(x - 2):
		if y[i] == y[i + 1] == y[i + 2] == 'x':
			v += 1
	print(v)
else:
	print('0')


n = int(input())
b = input()
b = list(b)
et = []
co = 0
for i in range(n):
	if b[i] == 'x':
		co += 1
	else:
		co = 0
	et.append(co)
pp = 0
for i in range(len(et)):
	if et[i] > 2:
		pp = pp + 1
print(pp)


n = int(input())
name = input()
prev_char = name[0]
num_in_row = 1 if prev_char == 'x' else 0
ans = 0
for i in range(1, n):
	curr = name[i]
	if curr == 'x':
		num_in_row += 1
	else:
		ans += max(0, num_in_row - 2)
		num_in_row = 0
ans += max(0, num_in_row - 2)
print(ans)


from sys import stdin
stdin.readline()
string = stdin.readline()
num_x = 0
ans = 0
for i in string:
	if i == 'x':
		if num_x >= 2:
			ans += 1
		num_x += 1
	else:
		num_x = 0
print(ans)


def read_nums():
	return [int(x) for x in input().split()]

def main():
	input()
	file_name = input()
	counts = []
	cur_count = 0
	for ch in file_name:
		if ch == 'x':
			cur_count += 1
		else:
			counts.append(cur_count)
			cur_count = 0
	counts.append(cur_count)
	res = 0
	for count in counts:
		res += max(0, count - 2)
	print(res)
main()


n = int(input(''))
s = input('')
l = []
count = 0
for b in range(0, n):
	j = s[b]
	l.append(j)
for k in range(0, n - 2):
	if l[k] == 'x' and l[k + 1] == 'x' and (l[k + 2] == 'x'):
		count = count + 1
		del l[k]
		l.insert(k, 0)
	else:
		pass
print(count)


n = int(input())
string = input()
count = 0
string_arr = list(string)
for i in range(n - 2):
	if string_arr[i] == 'x' and string_arr[i + 1] == 'x' and (string_arr[i + 2] == 'x'):
		count += 1
print(count)


def solve():
	n = int(input())
	s = input()
	X = 'xxx'
	if X not in s:
		print(0)
		return
	arr = list(s)
	count = 0
	i = 0
	while i + 2 < n:
		if arr[i] + arr[i + 1] + arr[i + 2] == X:
			count += 1
			i += 3
			while i < n and arr[i] == 'x':
				count += 1
				i += 1
		else:
			i += 1
	print(count)
solve()


x = int(input())
y = input()
count = 0
for c in range(x - 2):
	if y[c] == 'x' and y[c + 1] == 'x' and (y[c + 2] == 'x'):
		count = count + 1
print(count)


n = int(input())
a = input()
cnt = 1
ans = 0
for i in range(n - 1):
	if a[i] == a[i + 1] and a[i] == 'x':
		cnt += 1
	else:
		ans += max(0, cnt - 2)
		cnt = 1
ans += max(0, cnt - 2)
print(ans)


n = int(input())
string = input()
new_str = ''
total = 0
count = 0
for i in string:
	new_str = new_str + i
	if i == 'x':
		total = total + 1
		if total >= 3:
			new_str = new_str
			count = count + 1
	if i != 'x':
		total = 0
print(count)


import re

def main():
	n = int(input())
	s = input()
	rf = re.findall('[x]{3,}', string=s)
	cnt = 0
	for i in rf:
		cnt += len(i) - 2
	print(cnt)
main()


n = int(input())
s = input()
r = 0
i = 0
while i < n:
	flag = 0
	if s[i] == 'x':
		for j in range(i, n):
			if s[j] == 'x':
				flag += 1
			else:
				i = j - 1
				break
	if flag >= 3:
		r += flag - 2
		i = j - 1
	i += 1
print(r)


n = [int(x) for x in input().rstrip().split()][0]
data = [x for x in input().rstrip().split()][0]
sidx = -1
total = 0
for (i, c) in enumerate(data):
	if c == 'x' and sidx == -1:
		sidx = i
	if c != 'x' and sidx != -1:
		count = i - sidx
		if count > 2:
			total += count - 2
		sidx = -1
if sidx != -1:
	count = len(data) - sidx
	if count > 2:
		total += count - 2
print(total)


n = int(input())
s = input()
moves = 0
index = s.find('xxx')
while index != -1:
	s = s[:index] + s[index + 1:]
	moves += 1
	index = s.find('xxx')
print(moves)


n = int(input().strip())
s = input().strip()
n = len(s)
counter = 0
i = 0
while s.find('xxx', i, n) >= 0:
	i = s.find('xxx', i, n)
	i += 3
	counter += 1
	while i < n and s[i] == 'x':
		i += 1
		counter += 1
print(counter)


import logging
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logger.addHandler(ch)

def solve(s):
	return min_characters(s)

def min_characters(s, memo=None):
	q = []
	n = len(s)
	for (i, v) in enumerate(s):
		if len(q) < 2:
			q.append(v)
		elif v != 'x':
			q.append(v)
		elif q[-1] != 'x' or q[-2] != 'x':
			q.append(v)
	logger.debug(q)
	return n - len(q)

def main():
	_ = int(input().strip())
	s = input().strip()
	result = solve(s)
	print(result)
main()


n = int(input())
a = input()
num = 0
L = []
for i in range(n):
	if a[i] == 'x':
		num += 1
	elif a[i] != 'x':
		if num > 0:
			L.append(num)
		num = 0
if num > 0:
	L.append(num)
sum_num = 0
for i in L:
	sum_num += max(0, i - 2)
print(sum_num)


import sys
import itertools as it
next(sys.stdin)
xs = next(sys.stdin).rstrip()
result = 0
for (key, group) in it.groupby(xs):
	if key == 'x':
		result += max(0, len(list(group)) - 2)
print(result)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
ans = 0
t = 0
for i in z():
	if i == 'x':
		t += 1
		if t >= 3:
			ans += 1
	else:
		t = 0
print(ans)


t = int(input())
s = input()
while True:
	s = s.replace('xxx', 'xx')
	if 'xxx' in s:
		continue
	else:
		break
print(t - len(s))


n = int(input())
string = input()
remove = 0
xc = 0
for (i, v) in enumerate(string):
	if v == 'x':
		xc += 1
	else:
		xc = 0
	if xc >= 3:
		remove += 1
print(remove)


import os, sys
from io import BytesIO, IOBase

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
for i in range(1):
	n = ii()
	s = si()
	c = 0
	for i in range(n - 2):
		if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
			c += 1
	print(c)


t = int(input())
arr = input()
cnt = 0
rem = 0
for i in arr:
	if i == 'x':
		cnt += 1
		if cnt > 2:
			rem += 1
	else:
		cnt = 0
print(rem)


n = int(input())
fn = input()
x = fn.count('x')
ans = 0
for i in range(x, 2, -1):
	if 'x' * i in fn:
		ans += fn.count('x' * i)
		fn = fn.replace('x' * i, 'x' * (i - 1))
print(ans)


n = int(input())
s = str(input())
ans = 0
g = 0
for i in range(len(s)):
	if s[i] == 'x':
		g += 1
	else:
		if g > 2:
			ans += g - 2
		g = 0
if g > 2:
	ans += g - 2
print(ans)


n = int(input())
s = input()
cur = 0
ans = 0
for x in s:
	if x == 'x':
		cur += 1
		if cur == 3:
			ans += 1
			cur -= 1
	else:
		cur = 0
print(ans)


n = int(input())
line = input()
counter = 0
while 'xxx' in line:
	index = line.find('xxx')
	line = line[0:index] + line[index + 1:]
	counter += 1
print(counter)


n = int(input())
m = input()
p = m + '!'
a = 0
b = 0
c = 0
for i in range(n + 1):
	if p[i] == 'x':
		a = a + 1
	elif a > 2:
		b = a - 2
		c = c + b
		a = 0
	else:
		a = 0
print(c)


input()
(filename, counter) = (input(), 0)
while 'xxx' in filename:
	(filename, counter) = (filename.replace('xxx', 'xx', 1), counter + 1)
print(counter)


n = int(input())
s = [x for x in input()]
for i in range(n):
	k = ''.join(s[i:3 + i])
	if k == 'xxx':
		s[i] = '-'
print(s.count('-'))


from itertools import groupby
n = int(input())
name = input()
parse = [max(0, len(tuple(g)) - 2) for (k, g) in groupby(name) if k == 'x']
print(sum(parse))


n = int(input())
s = input()
initialNumber = s.count('x')
for n in range(len(s)):
	s = s.replace('xxx', 'xx')
finalNumber = s.count('x')
print(initialNumber - finalNumber)


n = int(input())
a = input()
ans = 0
x = 0
i = 0
while i < n:
	if a[i] != 'x':
		i += 1
		x = 0
		continue
	elif a[i] == 'x':
		j = i
		while j < n and a[j] == 'x':
			x += 1
			j += 1
		if x >= 3:
			ans += x - 2
		i = j
print(ans)


input()
file_name = input()
x_counter = 0
ans = 0
for char in file_name:
	if char == 'x':
		x_counter += 1
		if x_counter >= 3:
			ans += 1
	else:
		x_counter = 0
print(ans)


d = int(input())
n = input()
s = []
c = 0
for i in range(d):
	if n[i] != 'x':
		s.append(n[i])
		continue
	if len(s) >= 2:
		if s[-1] == 'x' and s[-2] == 'x':
			c += 1
		else:
			s.append(n[i])
	else:
		s.append(n[i])
print(c)


n = int(input())
a = input().strip()
k = 0
b = []
for i in a:
	b.append(i)
j = 0
while j < len(b):
	while j + 2 < len(b) and b[j] == 'x' and (b[j + 1] == 'x') and (b[j + 2] == 'x'):
		b.pop(j)
		k += 1
	j += 1
print(k)


N = int(input())
S = input()
count = 0
if 'xxx' not in S:
	print(0)
elif 'x' * N in S:
	print(N - 2)
else:
	S += '1'
	while 'xxx' in S:
		ind = S.index('xxx')
		S = S[ind + 2:]
		for i in S:
			indi = S.index(i)
			if i == 'x':
				count += 1
			else:
				break
		S = S[indi:]
	print(count)


j = 0
n = int(input())
s = list(input())
for i in range(n - 2):
	while s[i] == s[i + 1] == s[i + 2] == 'x':
		j += 1
		s.pop(i)
		s.append(' ')
print(j)


n = int(input())
file_name = input()
to_remove = 0
current_streak = 0
for i in range(n):
	if file_name[i] != 'x':
		current_streak = 0
		continue
	else:
		current_streak += 1
		if current_streak > 2:
			to_remove += 1
print(to_remove)


import sys
n = int(input())
lista = str(input())
count = 0
suma = 0
i = 0
flag = False
for i in range(len(lista)):
	if lista[i] == 'x':
		count += 1
		flag = False
	else:
		suma += count - 2 if count >= 3 else 0
		count = 0
		flag = True
if flag == False:
	suma += count - 2 if count >= 3 else 0
print(suma)


import re
n = int(input())
m = input()
error = re.findall('x{3}x*', m)
s = 0
for i in error:
	s = s + len(i) - 2
print(s)


import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().split()[0]
c = 0
for i in range(len(s)):
	for j in range(len(s)):
		if s[j:].startswith('xxx'):
			c += 1
			s = s[:j] + s[j + 1:]
print(c)


n = int(input())
x = input()
jlh = 0
for i in range(1, n - 1):
	if x[i] == 'x' and x[i] == x[i - 1] and (x[i] == x[i + 1]):
		jlh += 1
print(jlh)


n = int(input())
s = input()
count = start = 0
sub = 'xxx'
while True:
	start = s.find(sub, start) + 1
	if start > 0:
		count += 1
	else:
		print(count)
		break


a = int(input())
s = input()
h = len(s)
counter = 0
numx = 0
if 'xxx' not in s:
	print(0)
else:
	y = set(s)
	n = len(y)
	if n == 1:
		print(a - 2)
	else:
		for i in range(h - 2):
			if s[i] == 'x' and s[i + 1] == 'x':
				if s[i + 2] == 'x':
					counter += 1
		print(counter)


a = int(input())
s = input().strip()
if len(s) < 3:
	print(0)
else:
	c = 0
	for i in range(0, len(s) - 2):
		if s[i] == s[i + 1] == s[i + 2] == 'x':
			c += 1
	print(c)


n = int(input())
a = input()
count = 0
b = []
for i in a:
	if i == 'x':
		count += 1
	else:
		b.append(count)
		count = 0
if count != 0:
	b.append(count)
sumi = 0
for i in b:
	if i > 2:
		sumi += i - 2
print(sumi)


def main():
	removed = 0
	found = True
	n = int(input())
	fileName = input()
	index = fileName.find('xxx')
	if index == -1:
		found = False
	while found:
		fileName = fileName[index + 1:len(fileName)]
		removed = removed + 1
		index = fileName.find('xxx')
		if index == -1:
			found = False
	return removed
print(main())


n = int(input())
l = input()
c = 0
if l.count('xxx') == 0:
	print(0)
else:
	while l.count('xxx') != 0:
		c += l.count('xxx')
		l = l.replace('xxx', 'xx')
	print(c)


def slidingwindow(arr):
	match = ['x', 'x', 'x']
	k = 3
	cnt = 0
	for i in range(0, len(arr) - k + 1):
		if arr[i:i + k] == match:
			cnt += 1
	return cnt
n = int(input())
s = str(input())
arr = list(s)
print(slidingwindow(arr))


n = int(input())
a = input()
b = []
j = 0
ans = 0
for i in a:
	if i != 'x':
		ans += 1
		j = 0
	if i == 'x' and j != 2:
		j += 1
		ans += 1
	if i == 'x' and j == 2:
		l = 0
print(n - ans)


n = int(input())
s = input()
x = []
c = 0
ans = 0
for i in range(len(s)):
	if s[i] == 'x':
		c = c + 1
	else:
		x.append(c)
		c = 0
x.append(c)
for i in x:
	if i >= 3:
		ans += i - 2
print(ans)


n = input()
name = input()
erased_number = 0
while 'xxx' in name:
	name = name.replace('xxx', 'xx', 1)
	erased_number += 1
print(erased_number)


t = int(input())
m = str(input())
a = 0
c = 0
for i in range(t - 2):
	if m[i] == 'x' and m[i + 1] == 'x' and (m[i + 2] == 'x'):
		c += 1
print(c)


(n, s) = (int(input()), str(input()))
l = s
while s.find('xxx') != -1:
	s = s[0:s.find('xxx') + 1] + s[s.find('xxx') + 2:]
print(len(l) - len(s))


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	n = scanner()
	s = string()
	c = 1
	ans = 0
	z = 0
	for i in range(1, n):
		if s[i] == 'x' and s[i - 1] == 'x':
			c += 1
			z = max(c - 2, z)
		else:
			ans += z
			c = 1
			z = 0
	ans += z
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = 1
for i in range(t):
	solve()


n = int(input())
s = input()
if 'xxx' not in s:
	print(0)
else:
	s = list(s)
	ans = 0
	while True:
		for i in range(len(s) - 2):
			if s[i] + s[i + 1] + s[i + 2] == 'xxx':
				s.pop(i + 2)
				ans += 1
				break
		else:
			break
	print(ans)


n = int(input())
string = input().strip().lower()
count = 0
cons = 0
for char in string:
	if char == 'x':
		cons += 1
	else:
		if cons > 2:
			count += cons - 2
		cons = 0
if cons > 2:
	count += cons - 2
print(count)


from sys import stdin, stdout
len_file_name = int(stdin.readline())
file_name = stdin.readline()
min_char = 0
sub_xx = 0
i = 0
while i < len(file_name):
	if file_name[i] == 'x':
		if sub_xx <= 1:
			sub_xx += 1
		else:
			min_char += 1
	else:
		sub_xx = 0
	i += 1
print(min_char)


n = int(input())
s = input()
cl = []
i = 0
count = 0
while i < n:
	if s[i] == 'x':
		count += 1
	else:
		if count >= 3:
			cl.append(count)
		count = 0
	i += 1
if count >= 3:
	cl.append(count)
res = 0
for x in cl:
	res += x - 2
print(res)


n = int(input())
q = input()
c = 0
i = 0
while i < n - 2:
	if q[i:i + 3] == 'xxx':
		q = q[:i] + q[i + 1:]
		n -= 1
		c += 1
	else:
		i += 1
print(c)


useless = int(input())
strr = list(input())
count = 0
for i in range(useless - 2):
	if strr[i] == 'x' and strr[i + 1] == 'x' and (strr[i + 2] == 'x'):
		strr[i] = '#'
		count += 1
print(count)


def fileName(n, s):
	count = 0
	result = 0
	for i in range(n):
		if s[i] == 'x':
			count += 1
		else:
			count = 0
		if count >= 3:
			result += 1
	print(result)
n = int(input())
s = input()
fileName(n, s)


n = int(input())
t = input() + 'i'
(k, c, r) = (0, 0, 0)
while k < n + 1:
	if t[k] != 'x':
		if c > 2:
			r += c - 2
		c = 0
	else:
		c += 1
	k += 1
print(r)


n = int(input())
s = input()
for i in range(1000):
	s = 'xx'.join(s.split('xxx'))
print(n - len(s))


import sys
n = int(sys.stdin.readline())
fname = sys.stdin.readline().strip()
nrem = 0
for i in range(len(fname) - 2):
	if fname[i:i + 3] == 'xxx':
		nrem += 1
print(nrem)


a = int(input())
b = input()
count = 0
l = []
for i in b:
	if i == 'x':
		count += 1
	elif count > 2:
		l.append(count - 2)
		count = 0
	else:
		count = 0
if count > 2:
	l.append(count - 2)
print(sum(l))


n = int(input())
s = str(input())
removal = 0
counter = 0
for x in s:
	if x != 'x':
		if counter >= 3:
			removal += counter - 2
		counter = 0
	elif x == 'x':
		counter += 1
if counter >= 3:
	removal += counter - 2
print(removal)


num = int(input())
name = input()
s = name
while name.count:
	name = name.replace('xxx', 'xx')
	if name.count('xxx') == 0:
		print(s.count('x') - name.count('x'))
		break
	else:
		continue


n = int(input())
st = input()
ans = 0
for i in range(0, n - 2):
	if st[i:i + 3] == 'xxx':
		ans += 1
print(ans)


a = input()
b = input()
c = 0
for i in range(len(b) - 2):
	d = b[i] + b[i + 1] + b[i + 2]
	if d == 'xxx':
		c += 1
print(c)


n = int(input())
s = input()
a = []
for i in range(len(s) - 2):
	a.append(s[i:i + 3])
print(a.count('xxx'))


a = int(input())
k = list(input())
d = 0
r = 0
for i in range(a):
	if k[i] == 'x':
		d += 1
	else:
		d = 0
	if d == 3:
		r += 1
		d = 2
print(r)


n = int(input())
name = input()
counter = 0
for i in range(n):
	if 'xxx' in name:
		name = name.replace('xxx', 'xx', 1)
		counter += 1
print(counter)


l = int(input())
file_name = input()
while 'xxx' in file_name:
	file_name = file_name.replace('xxx', 'xx')
print(l - len(file_name))


num = int(input())
strInput = input()
counter = 0
strTolist = list(strInput)
while True:
	a = strInput.find('xxx')
	if a == -1:
		break
	else:
		del strTolist[a]
		counter += 1
		strInput = ''.join(map(str, strTolist))
print(counter)


n = int(input())
s = input()
list_ = []
for i in range(n):
	k = s[i:i + 3] == 'xxx'
	list_.append(k)
print(list_.count(True))


def main():
	n = input()
	s = input()
	ref = 'xxx'
	cnt = 0
	while s.find(ref) != -1:
		cnt += 1
		s = s[s.find(ref) + 1:]
	print(cnt)
main()


n = int(input(''))
s = input('')
ls = []
a = ''
flag = 0
for i in range(len(s)):
	if s[i] == 'x':
		a = a + s[i]
		flag += 1
	else:
		if len(a) != 0:
			ls.append(a)
		a = ''
		flag = 0
if flag != 0:
	ls.append(a)
if len(ls) == 0:
	print(0)
else:
	count = 0
	for i in range(len(ls)):
		if len(ls[i]) >= 3:
			count += len(ls[i]) - 2
	print(count)


n = int(input())
s = input()
m = []
for i in s:
	m.append(i)
count = 0
for i in range(n - 2):
	if m[i] == 'x' and m[i + 1] == 'x' and (m[i + 2] == 'x'):
		count += 1
print(count)


a = int(input())
b = input()
d = 0
k = 0
j = 3
while j < len(b) + 1:
	if b[k:j] == 'xxx':
		d += 1
	k += 1
	j += 1
print(d)


from itertools import groupby
n = int(input())
s = input()
ans = sum((max(0, sum((1 for _ in g)) - 2) for (k, g) in groupby(s) if k == 'x'))
print(ans)


n = int(input())
cadena = input()
contadorx = 0
remover = 0
for i in cadena:
	if i == 'x':
		contadorx += 1
	else:
		contadorx = 0
	if contadorx >= 3:
		remover += 1
print(remover)


n = int(input())
s = input()
s2 = [0]
for i in range(n):
	if s[i] == 'x':
		if s2[-1] != 'x' or s2[-2] != 'x':
			s2.append(s[i])
	else:
		s2.append(s[i])
r = n - (len(s2) - 1)
print(r)


lens = int(input())
l = input()
a = 0
t = 0
for i in range(lens):
	if l[i] == 'x':
		a += 1
	else:
		a = 0
	if a >= 3:
		t += 1
print(t)


n = int(input())
s = input()
x_sum = 0
x_counter = 0
for i in range(n):
	if s[i] == 'x':
		x_counter += 1
	elif x_counter > 0:
		x_sum += max(0, x_counter - 2)
		x_counter = 0
x_sum += max(0, x_counter - 2)
print(x_sum)


n = int(input())
s = input()
flag = False
cont = []
for x in s:
	if flag:
		if x == 'x':
			cont[-1] += 1
		else:
			flag = False
	elif x == 'x':
		flag = True
		cont.append(1)
ans = 0
for c in cont:
	if c > 2:
		ans += c - 2
print(ans)


n = int(input())
s = input()
xx = 0
count = 0
for i in range(len(s)):
	if s[i] == 'x':
		xx += 1
		if xx >= 3:
			count += 1
	else:
		xx = 0
print(count)


n = int(input())
s = input()
r = 0
while s.find('xxx') != -1:
	s = s.replace('xxx', 'xx', 1)
	r += 1
print(r)


n = int(input())
s = input()
x_c = 0
count = 0
for let in s:
	if let == 'x':
		x_c += 1
	else:
		x_c = 0
	if x_c > 2:
		count += 1
print(count)


n = int(input())
string = input()
x = 0
if n < 3:
	print(str(0))
else:
	for i in range(n - 2):
		if string[i] == 'x' and string[i + 1] == 'x' and (string[i + 2] == 'x'):
			x += 1
	if x == 0:
		print(str(0))
	else:
		print(str(x))


n = int(input())
st = input()
answer = 0
index = st.find('x')
while index >= 0:
	xcount = 1
	index += 1
	while index < len(st) and st[index] == 'x':
		xcount += 1
		index += 1
	if xcount >= 3:
		answer += xcount - 2
	st = st[index:]
	index = st.find('x')
print(answer)


n = int(input())
s = input()
answer = 0
while 'xxx' in s:
	s = list(s)
	for i in range(2, len(s)):
		if s[i] + s[i - 1] + s[i - 2] == 'xxx':
			s[i] = ''
			answer += 1
	s = ''.join(s)
print(answer)


n = int(input())
s = input()
cnt = 0
to_del = 0
for i in range(n):
	if s[i] == 'x':
		if cnt == 2:
			to_del += 1
		else:
			cnt += 1
	else:
		cnt = 0
print(to_del)


b = int(input())
a = input()
c = 0
temp = 0
for i in a:
	b = b - 1
	if i == 'x':
		c = c + 1
	if i != 'x' or b == 0:
		temp = temp + ((c if c >= 2 else 2) - 2)
		c = 0
print(temp)


n = int(input())
s1 = input()
k = 1
c = 0
for i in range(n - 1):
	if s1[i + 1] == 'x' and s1[i] == 'x' and (s1[i + 1] == s1[i]):
		k += 1
		if k >= 3:
			c += 1
	else:
		k = 1
print(c)


n = int(input())
s = input()
ans = 0
while 'xxx' in s:
	ind = s.index('xxx')
	s = list(s)
	s[ind:ind + 3] = ['x', 'x']
	s = ''.join(s)
	ans += 1
print(ans)


n = int(input().strip())
s = input().strip()
n = len(s)
occurence_count = [1 for (i, si) in enumerate(s) if s[i:i + 3] == 'xxx']
print(sum(occurence_count))


n = int(input())
p = input().rstrip()
x = list(p)
X = 0
for i in range(0, n - 3 + 1):
	c = x[i:i + 3]
	if ''.join(c) == 'xxx':
		X += 1
print(X)


x = int(input())
y = input()
z = 0
while y.find('xxx') != -1:
	z += y.count('xxx')
	y = y.replace('xxx', 'xx')
print(z)


def main():
	N = int(input())
	S = input()
	rm = 0
	xn = 0
	for s in S:
		if s == 'x':
			xn += 1
			if xn > 2:
				rm += 1
		else:
			xn = 0
	print(rm)
main()


a = input()
b = input()
s = 0
total = []
for i in b:
	if i == 'x':
		s += 1
	else:
		total.append(s)
		s = 0
total.append(s)
q = 0
for i in total:
	if i > 2:
		q += i - 2
print(q)


count = 0
a = int(input())
s = str(input())
for i in range(0, a - 2):
	if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		count += 1
print(count)


length = int(input())
x = input()
r = 0
i = 0
while i < len(x) - 2:
	if x[i] == 'x' and x[i + 1] == 'x' and (x[i + 2] == 'x'):
		r += 1
	i += 1
print(r)


n = int(input())
ss = input()
word = ''
counter = 0
for s in ss:
	if s == 'x':
		word += 'x'
		if len(word) >= 3:
			counter += 1
	else:
		word = ''
print(counter)


n = int(input())
x = input()
total = 0
suma = 0
for i in x:
	if i == 'x':
		suma += 1
	else:
		if suma > 2:
			total += suma - 2
		suma = 0
if suma > 2:
	total += suma - 2
print(total)


n = int(input())
s = input()
sum = 0
c = 0
for i in range(len(s)):
	if s[i] == 'x':
		c += 1
	elif s[i] != 'x' and c < 3:
		c = 0
		continue
	elif s[i] != 'x' and c >= 3:
		sum += c - 2
		c = 0
	if i == len(s) - 1 and c >= 3:
		sum += c - 2
		c = 0
print(sum)


n = int(input())
s = input()
y = z = 0
for i in range(n):
	if s[i] == 'x':
		y += 1
		if y > 2:
			z += 1
	else:
		y = 0
print(z)


import os
import sys
n = int(input())
a = input()
a = list(a)
count = 0
i = 0
while i < len(a) - 2:
	if a[i] == a[i + 1] == a[i + 2] == 'x':
		a.pop(i + 2)
		i -= 1
		count += 1
	i += 1
print(count)


import re
zxjnb = input()
s = input()
l = re.findall('x+', s)
print(sum((max(0, len(i) - 2) for i in l)))


import re

def main():
	n = int(input())
	s = input()
	n = re.sub('x{3,}', 'xx', s)
	print(len(s) - len(n))
main()


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def insr():
	s = input()
	return list(s[:len(s) - 1])

def isSubArray(A, B, n, m):
	i = 0
	j = 0
	while i < n and j < m:
		if A[i] == B[j]:
			i += 1
			j += 1
			if j == m:
				return i - m
		else:
			i = i - j + 1
			j = 0
	return -1
n = inp()
s = insr()
x = ['x', 'x', 'x']
ind = isSubArray(s, x, n, 3)
c = 0
while ind != -1:
	s.pop(ind)
	n -= 1
	ind = isSubArray(s, x, n, 3)
	c += 1
print(c)


import re
input()
st = input()
match = [len(i) - 2 for i in re.findall('x{3,}', st)]
print(sum(match))


n = int(input())
file = input()
x = []
last_x = False
for l in file:
	if l != 'x':
		last_x = False
	elif last_x:
		x[-1] += 1
	else:
		x.append(1)
		last_x = True
x = [i - 2 for i in x if i > 2]
print(sum(x))


n = input()
k = str(input())
count = 0
total = 0
prev = ''
for i in k:
	if i == 'x':
		count += 1
	else:
		count = 0
	prev = i
	if count == 3:
		total += 1
		count -= 1
print(total)


input()
s = input()
cnt = 0
for i in range(len(s)):
	if s[i:i + 3] == 'xxx':
		cnt += 1
print(cnt)


n = input()
s = str(input())
c = 0
rem = 0
for i in s:
	if i == 'x':
		if c >= 2:
			rem += 1
		else:
			c += 1
	else:
		c = 0
print(rem)


n = int(input())
s = input()
a = len(s)
while True:
	s = s.replace('xxx', 'xx')
	if 'xxx' in s:
		continue
	else:
		break
print(a - len(s))


n = int(input())
s = input()
cnt = 0
rcnt = 0
for char in s:
	if char == 'x':
		cnt += 1
		if cnt > 2:
			rcnt += 1
	else:
		cnt = 0
print(rcnt)


am = int(input())
arr = list(input())
d = 0
for i in range(am - 2):
	w = 0
	for g in range(3):
		if arr[i + g] == 'x':
			w += 1
	d += w == 3
print(d)


n = int(input())
s = input() + 'a'
(ans, i) = (0, 0)
while i < n:
	if s[i] == 'x':
		(l, r) = (i, i)
		while s[r] == 'x':
			r += 1
		ans += max(0, r - l - 2)
		i = r
	i += 1
print(ans)


def main():
	import re
	input()
	s = input()
	xxx = re.compile('x{3,}').findall(s)
	counts = sum((len(x) - 2 for x in xxx))
	print(counts)
main()


n = int(input())
s = input()
b = 0
for i in range(len(s)):
	if i == len(s) - 2:
		break
	elif s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
		b += 1
print(b)


n = int(input())
s = input()
x = s.find('xxx')
if x + 1 == 0:
	print(0)
else:
	t = s[x]
	c = 0
	ans = 0
	for i in range(x + 1, n):
		if s[i] == 'x':
			c += 1
		else:
			c = 0
		if s[i] == 'x' and t == 'x' and (c > 2):
			ans += 1
	print(ans + 1)


input()
x = num = 0
for letter in input():
	if letter == 'x':
		x += 1
	else:
		x = 0
	if x > 2:
		num += 1
print(num)


input()
S = input()

def occurances(s1, s2):
	count = 0
	pos = 0
	while pos < len(s1):
		pos = s1.find(s2, pos, len(s1)) + 1
		if pos == 0:
			break
		count += 1
	return count
print(occurances(S, 'xxx'))


p = int(input())
o = input() + '  '
print(sum((1 for i in range(p) if o[i:i + 3] == 'xxx')))


n = int(input())
s = input()
count = 0
while s.find('xxx', 0, len(s)) != -1:
	ind = s.find('xxx', 0, len(s))
	s = s[:ind] + s[ind + 1:]
	count += 1
print(count)


n = int(input())
t = input()
ct = 0
if len(t) < 3:
	print('0')
else:
	for i in range(2, n):
		if t[i] == 'x':
			if t[i - 1] == 'x' and t[i - 2] == 'x':
				ct += 1
	print(ct)


n = int(input())
s = input()
s += ' '
a = [x for x in s]
res = 0
cnt = 0
for i in range(n + 1):
	if a[i] == 'x':
		cnt += 1
	else:
		if cnt >= 3:
			res += cnt - 2
		cnt = 0
print(res)


n = int(input())
s = input() + '0'
(sum, c_x) = (0, 0)
for i in range(n):
	if s[i] == 'x':
		c_x += 1
		if s[i + 1] != 'x' and c_x >= 3:
			sum += max(0, c_x - 2)
			c_x = 0
	else:
		c_x = 0
print(sum)


n = int(input())
file_name = input()
result = 0
for i in range(n):
	count = file_name.count('xxx')
	if count == 0:
		break
	file_name = file_name.replace('xxx', 'xx')
	result += count
print(result)


n = int(input())
s = input()
xcount = s.count('x')
if xcount < 3:
	print(0)
else:
	counter = 0
	for i in range(n):
		if s[i:i + 3] == 'xxx':
			counter += 1
	print(counter)


input()
cadena = input()
xxx = True
cont = 0
for i in range(len(cadena) - 2):
	if cadena[i:i + 3] == 'xxx':
		cont += 1
print(cont)


def f(s):
	cur = 0
	ans = 0
	for el in s:
		if el == 'x':
			cur += 1
		else:
			ans += max(0, cur - 2)
			cur = 0
	ans += max(0, cur - 2)
	return ans
n = int(input())
s = input()
print(f(s))


qtd = int(input())
string = input()
count = 0
for i in range(1, qtd - 1):
	if string[i] == string[i - 1] and string[i] == string[i + 1] and (string[i] == 'x'):
		count += 1
print(count)


c = int(input())
a = input()
b = 0
for i in range(c - 2):
	if a.find('xxx') == -1:
		break
	else:
		a = a[:a.find('xxx')] + a[a.find('xxx') + 1:]
		b += 1
print(b)


n = int(input())
s = input()
l = 0
a = []
sumz = 0
for i in range(n):
	if s[i] == 'x':
		l += 1
	else:
		a.append(l)
		l = 0
a.append(l)
for i in a:
	if i > 2:
		sumz += i - 2
print(sumz)


n = int(input())
str = input()
l = list(str)
f = 0
count = 0
while f == 0:
	str = ''.join(l)
	x = str.find('xxx')
	if x == -1:
		break
	else:
		count += 1
		del l[x]
print(count)


x = int(input())
y = input()
c = 1
l = []
for i in range(len(y) - 1):
	if y[i + 1] == y[i] and y[i] == 'x':
		c = c + 1
	else:
		l = l + [c]
		c = 1
l = l + [c]
l = list(filter(lambda x: x >= 3, l))
l = list(map(lambda x: x - 2, l))
print(sum(l))


n = int(input())
s = input()
m = 0
for i in range(n):
	if i <= n - 3:
		if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
			m += 1
print(m)


n = int(input())
s = input()
cnt = 0
while 'xxx' in s:
	cnt += 1
	ind = s.find('xxx')
	s = s[:ind] + s[ind + 1:]
print(cnt)


x = int(input())
y = input()
a = 0
b = 0
for i in range(x):
	if y[a:a + 3] == 'xxx':
		b += 1
		a += 1
	else:
		a += 1
print(b)


n = int(input())
s = input()
count = 0
while 'xxx' in s:
	a = s.find('xxx')
	s = s[0:a] + s[a + 1:n]
	count += 1
print(count)


n = int(input())
s = list(input())
s.append('!')
ans = 0
cnt = 0
for t in s:
	if t == 'x':
		cnt += 1
	else:
		ans += max(cnt - 2, 0)
		cnt = 0
print(ans)


def file_name(s):
	ans = 0
	i = 0
	count = 0
	while i < len(s):
		if s[i] == 'x':
			count += 1
			if count >= 3:
				ans += 1
		else:
			count = 0
		i += 1
	return ans
n = int(input())
s = input()
print(file_name(s))


n = int(input())
x = input()
if 'xx' not in x:
	print(0)
else:
	(count, res) = (0, [])
	for i in range(n):
		if x[i] == 'x':
			count += 1
			if i + 1 == n or x[i + 1] != 'x':
				res.append(count)
			else:
				continue
		else:
			count = 0
	print(sum([i - 2 for i in res if i >= 3]))


a = input()
b = input() + ' '
c = ''
d = 0
for i in b:
	if i == 'x':
		c = c + i
	else:
		if len(c) >= 3:
			d = d + (len(c) - 2)
		c = ''
print(d)


n = int(input())
huruf = input()
hasil = 0
total = 0
j = 1
for i in huruf:
	if i == 'x':
		hasil += 1
	if i != 'x':
		if hasil >= 3:
			total += hasil - 2
			hasil = 0
		else:
			hasil = 0
	elif j == len(huruf) and huruf[-1] == 'x':
		if hasil >= 3:
			total += hasil - 2
	j += 1
print(total)


n = int(input())
s = input()
list1 = [i for i in s]
s2 = ''
count = 0
for i in range(n):
	if s[i:i + 3] == 3 * 'x':
		count += 1
	else:
		s2 += s[i]
print(count)


n = int(input())
a = str(input())
s = 0
p = 0
for i in range(n):
	if a[i] == 'x':
		s = s + 1
	elif s > 2:
		p = p + s - 2
		s = 0
	else:
		s = 0
if a[n - 1] == 'x' and s > 2:
	p = p + s - 2
print(int(p))


num = int(input())
i = 0
s4et4ik = 0
t = 0
if 3 <= num <= 100:
	stroka = input()
	for __ in range(num):
		if stroka[i] == 'x':
			s4et4ik += 1
			if s4et4ik >= 3:
				t += 1
		elif stroka[i] != 'x':
			s4et4ik = 0
		i += 1
print(t)


import time

def verifyName(lenName, name):
	cToDelete = 0
	cntX = 0
	for x in range(lenName):
		if name[x] == 'x':
			cntX += 1
			if cntX > 2:
				cToDelete += 1
		else:
			cntX = 0
	return cToDelete

def solve():
	lenName = int(input())
	name = input()
	print(verifyName(lenName, name))
solve()


n = input()
s = input()
ans = 0
t = 0
for x in s:
	if x == 'x':
		t += 1
	else:
		if t > 2:
			ans += t - 2
		t = 0
if t > 2:
	ans += t - 2
t = 0
print(ans)


n = int(input())
string = input()
count = 0
answer = 0
aux_str = ''
for i in string:
	if i == 'x':
		count += 1
		if count < 3:
			aux_str += i
		else:
			count -= 1
			answer += 1
	else:
		count = 0
		aux_str += i
print(answer)


n = int(input())
s = input()
c = 0
l = []
d = []
f = 0
if 'x' not in s:
	print(0)
elif len(set(s)) == 1:
	if s[0] == 'x':
		print(len(s) - 2)
	else:
		print(0)
else:
	for i in range(len(s)):
		if s[i] == 'x':
			c += 1
			l.append(c)
		if s[i] != 'x':
			d.append(c)
			c = 0
	if l[-1] >= 3 and s[-1] == 'x':
		f += l[-1] - 2
	for j in range(len(d)):
		if d[j] >= 3:
			f += d[j] - 2
	print(f)


n = int(input())
s = list(input())
count = 0
for i in range(1, n - 1):
	if s[i] == 'x' and s[i - 1] == 'x' and (s[i + 1] == 'x'):
		count += 1
print(count)


n = int(input())
s = input()
import re
x = re.findall('x{3,}', s)
if not len(x):
	print(0)
else:
	s = 0
	for mx in x:
		s += len(mx) - 2
	print(s)


import re
x = int(input())
y = input()
a = 0
z = re.findall('x*', y)
for i in z:
	if len(i) >= 3:
		a += abs(2 - len(i))
	else:
		pass
print(a)


a = int(input())
b = input()
c = ' '
d = []
e = 0
for i in b:
	if c == ' ' and i == 'x':
		c = i
	elif c[e] == 'x' and i == 'x':
		c += i
		e += 1
	else:
		d.append(len(c))
		c = ' '
		e = 0
d.append(len(c))
f = 0
for i in d:
	if i > 2:
		f += i - 2
	else:
		f += 0
print(f)


import sys
from collections import Counter, defaultdict as ddict
from pprint import pprint
from functools import lru_cache
from heapq import *
from itertools import zip_longest
from string import *
cache = lru_cache(None)
rl = lambda : next(sys.stdin, '').rstrip('\n')
ri = lambda : int(rl())
rfs = lambda : rl().split()
ris = lambda : list(map(int, rfs()))
rds = lambda : list(map(float, rfs()))
n = ri()
s = rl()
ans = k = 0
for c in s:
	if c != 'x':
		k = 0
	elif k >= 2:
		ans += 1
	else:
		k += 1
print(ans)


n = int(input())
str = input()
res = 0
for i in range(len(str)):
	if str[i:i + 3] == 'xxx':
		res += 1
print(res)


n = int(input())
t = input()
tot = 0
b = True
while b:
	b = False
	for i in range(len(t) - 2):
		if t[i] == 'x' and t[i + 1] == 'x' and (t[i + 2] == 'x'):
			b = True
			t = t[:i + 1] + t[i + 2:]
			tot += 1
			break
print(tot)


n = input()
filename = input()
x_counter = 0
ans = 0
for i in range(0, len(filename)):
	if filename[i] == 'x':
		if x_counter == 2:
			ans = ans + 1
		else:
			x_counter = x_counter + 1
	else:
		x_counter = 0
print(ans)


N = int(input())
S = list(input())
if S.count(S[0]) == N and S[0] == 'x':
	print(N - 2)
elif 'x' not in S:
	print(0)
else:
	re = 0
	h = 0
	for i in range(0, N):
		if S[i] == 'x':
			h = h + 1
		elif h > 2:
			re = re + (h - 2)
			h = 0
		else:
			h = 0
	if h > 2:
		re = re + (h - 2)
	print(re)


input()
name = input()
start = len(name)
while 'xxx' in name:
	name = name.replace('xxx', 'xx')
print(start - len(name))


n = int(input())
filename = input()
cx = 0
r = 0
for c in filename:
	if c == 'x':
		cx += 1
	else:
		if cx > 2:
			r += cx - 2
		cx = 0
if cx > 2:
	r += cx - 2
print(r)


n = int(input())
word = input()
count = 0
sub = 0
for letter in word:
	if letter == 'x':
		count += 1
	else:
		count = 0
	if count > 2:
		sub += 1
print(sub)


n = int(input())
string = str(input())
c = 0
for i in range(len(string) - 2):
	if string[i] + string[i + 1] + string[i + 2] == 'xxx':
		c += 1
print(c)


n = int(input())
s = input()[:n] + ' '
nx = 0
res = 0
for c in s:
	if nx and c != 'x':
		res += max(0, nx - 2)
		nx = 0
	elif c == 'x':
		nx += 1
print(res)


(z, zz, dgraphs) = (input, lambda : list(map(int, z().split())), {})
from string import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
z()
(c, d) = (0, 0)
for i in z():
	if i == 'x':
		c += 1
	else:
		c = 0
	if c >= 3:
		d += 1
print(d)


n = int(input())
word = input()
counter = 0
counter1 = 0
for i in range(0, len(word)):
	if word[i] == 'x':
		counter += 1
		if counter > 2:
			counter1 += 1
	else:
		counter = 0
print(counter1)


import sys

def main():
	n = int(sys.stdin.readline().strip())
	p = sys.stdin.readline()
	res = p[:2]
	counter = 0
	if len(p) < 2:
		print(0)
	else:
		for i in range(2, n):
			if p[i] == 'x' and res[-2:] == 'xx':
				counter += 1
			else:
				res += p[i]
		print(counter)
main()


n = int(input())
A = list(input())
sum = 0
for i in range(n - 2):
	if A[i] == A[i + 1] == A[i + 2] == 'x':
		sum += 1
print(sum)


n = int(input())
f = str(input())
h = list(f)
x = 0
t = 0
for i in range(0, n):
	if h[i] == 'x' and x < 3:
		x += 1
	if h[i] == 'x' and x >= 3:
		t += 1
		x += 1
	elif h[i] != 'x' and x != 0:
		x = 0
print(t)


a = int(input())
s = input()
z = []
total = 0
for i in range(len(s)):
	z.append(s[i])
count = 0
for i in range(len(z)):
	if z[i] == 'x':
		if i == 0:
			count = 1
		else:
			if count == 0:
				count = 1
			if z[i - 1] == 'x':
				count += 1
	else:
		if count > 0:
			total += max(0, count - 2)
		count = 0
if count > 0:
	total += max(0, count - 2)
print(total)


y = int(input())
x = str(input())
output = 0
for j in range(len(x) - 2):
	if x[j] == 'x' and x[j + 1] == 'x' and (x[j + 2] == 'x'):
		output += 1
print(output)


def max1(a):
	p = a[0]
	for x in a:
		if x > p:
			p = x
	return p

def preobr(x):
	if x % 2 == 1:
		return x + 1
	else:
		return x - 1

def prlist(a):
	for x in a:
		print(x, end=' ')

def dlin(n):
	k = 0
	while n > 0:
		n -= k
		k += 1
	return k - 1
n = int(input())
a = input()
t = a.find('xxx')
if t == -1:
	print(0)
else:
	k = 0
	while a.find('xxx') != -1:
		a = a[0:a.find('xxx')] + a[a.find('xxx') + 1:len(a)]
		k += 1
	print(k)


a = int(input())
b = input()
counter = 0
delete = 0
for i in range(len(b)):
	if b[i] == 'x':
		counter += 1
	elif b[i] != 'x':
		counter = 0
	if counter >= 3:
		delete += 1
print(delete)


def removeXXX(fileName):
	index = fileName.find('xxx')
	occurence = 0
	while index >= 0:
		fileName = fileName.replace('xxx', 'xx', 1)
		index = fileName.find('xxx')
		occurence += 1
	return occurence
size = int(input())
fileName = str(input())
print(removeXXX(fileName))


n = int(input())
file_name = input()
streak = 0
removed = 0
for i in range(n):
	if file_name[i] == 'x':
		if streak == 2:
			removed += 1
		else:
			streak += 1
	else:
		streak = 0
print(removed)


n = int(input())
s = input()
s = s + '~'
ctr = 1
mkr = []
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		ctr = ctr + 1
	else:
		mkr.append(s[i])
		mkr.append(ctr)
		ctr = 1
l = 0
m = 0
for i in range(len(mkr) - 1):
	if mkr[i] == 'x' and int(mkr[i + 1]) >= 3:
		l = l + int(mkr[i + 1])
		m = m + 1
if l >= 3:
	print(l - 2 * m)
else:
	print(l)


import re
input()
print(len(re.findall('(?=xxx)', input())))


n = int(input())
string = input()
count = 0
for i in range(len(string)):
	if 'xxx' in string[i:i + len('xxx')]:
		count += 1
print(count)


import re
input()
inp = input().strip()
groups = re.findall('x{2,}', inp)
total = sum([len(g) - 2 for g in groups])
print(total)


l = int(input())
s = input()
ans = 0
for i in range(l - 3 + 1):
	count = 0
	for j in range(i, i + 3):
		if s[j] == 'x':
			count += 1
	if count == 3:
		ans += 1
print(ans)


import sys
line = sys.stdin.readline().strip()
name = sys.stdin.readline().strip()
res = 0
number = 0
for letter in name:
	if letter == 'x':
		number += 1
	elif number >= 3:
		res += number - 2
		number = 0
	else:
		number = 0
if name[-1] == 'x':
	if number >= 3:
		res += number - 2
print(res)


l = int(input())
s = input()
n = True
while n:
	if 'xxx' in s:
		s = s.replace('xxx', 'xx')
	else:
		n = False
print(l - len(s))


n = int(input())
s = input()
cnt = 0
get = 0
for i in range(len(s)):
	if s[i] == 'x':
		cnt += 1
	else:
		cnt = 0
	if cnt == 3 or cnt > 3:
		get += 1
print(get)


n = int(input())
s = input()
count = 0
res = 0
for i in range(len(s)):
	if s[i] == 'x':
		count += 1
	else:
		res += max(0, count - 2)
		count = 0
if count:
	res += max(0, count - 2)
print(res)


length = int(input())
name = input()
i = 0
count = 0
while i < length - 2:
	if name[i] == name[i + 1] == name[i + 2] == 'x':
		count += 1
	else:
		pass
	i += 1
print(count)


n = int(input())
palabra = input()
cnt = 0
for i in range(0, n - 2):
	if palabra[i] == 'x' and palabra[i + 1] == 'x' and (palabra[i + 2] == 'x'):
		cnt += 1
print(cnt)


import sys
input = sys.stdin.readline
N = int(input())
S = input().strip()
cnt = 0
i = 0
while i < N:
	if S[i] == 'x':
		curr = 0
		while i < N and S[i] == 'x':
			curr += 1
			i += 1
		cnt += max(0, curr - 2)
	i += 1
print(cnt)


n = int(input())
s = input()
space = 0
ans = 0
for i in s:
	if i == 'x':
		space += 1
	else:
		if space >= 3:
			ans += space - 2
		space = 0
if space >= 3:
	ans += space - 2
print(ans)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	N = Scanner.int()
	S = Scanner.string()
	ans = 0
	for i in range(N - 2):
		if S[i:i + 3] == 'xxx':
			ans += 1
	print(ans)
main()


import sys
import filecmp
import math
FILE_IO = False
if FILE_IO:
	input_stream = open('input_test.txt')
	sys.stdout = open('current_output.txt', 'w')
else:
	input_stream = sys.stdin
n = int(input_stream.readline())
input_list = input_stream.readline()
seqence = False
seqence_count = 0
result = 0
for elem in input_list:
	if elem == 'x':
		seqence_count += 1
		seqence = True
	else:
		if seqence_count > 2:
			result += seqence_count - 2
		seqence = False
		seqence_count = 0
if seqence_count > 2:
	result += seqence_count - 2
print(result)
if FILE_IO:
	assert filecmp.cmp('current_output.txt', 'expected_output.txt', shallow=False) == True


n = int(input())
s = str(input())
if 'xxx' not in s:
	print(0)
else:
	while 'xxx' in s:
		s = s.replace('xxx', 'xx')
	print(n - len(s))


n = int(input())
s = str(input())
count = 0
for j in range(n - 2):
	if s[j] == 'x' and s[j + 1] == 'x' and (s[j + 2] == 'x'):
		count += 1
print(count)


def main():
	n = int(input())
	s = input().strip()
	s = s + 'o'
	cnt_x = 0
	cnt = 0
	for c in s:
		if c == 'x':
			cnt_x += 1
		else:
			if cnt_x > 2:
				cnt += cnt_x - 2
			cnt_x = 0
	print(cnt)
main()


n = int(input())
s = input()
cnt = []
flag = 0
for i in s:
	if i == 'x' and flag == 0:
		flag = 1
		cnt.append(1)
	elif i == 'x' and flag == 1:
		cnt[-1] += 1
	elif flag == 1:
		flag = 0
res = 0
for i in cnt:
	res += max(0, i - 2)
print(res)


lencode = int(input())
code = input()
substring = 'xxx'
if substring in code:
	while True:
		code = code.replace(substring, 'xx')
		if substring in code:
			continue
		else:
			break
	print(lencode - len(code))
else:
	print(0)


n = int(input())
A = list(input())
total = 0
i = 0
while i < len(A):
	if A[i] == 'x':
		xs = 0
		for j in range(i, i + len(A[i:])):
			if A[j] == 'x':
				xs += 1
				if xs >= 3:
					total += 1
			else:
				break
		i = j + 1
	else:
		i += 1
print(total)


t = input()
x = input()
(numx, remove) = (0, 0)
for i in x:
	if i == 'x':
		numx = numx + 1
		if numx > 2:
			remove = remove + 1
	else:
		numx = 0
print(remove)


n = int(input())
str = input()
ct = 0
started = 0
res = 0
for i in range(0, n):
	if str[i] == 'x':
		if started:
			ct = ct + 1
		else:
			started = 1
			ct = 1
	else:
		started = 0
		res = res + max(0, ct - 2)
		ct = 0
res = res + max(0, ct - 2)
print(res)


n = int(input())
s = str(input())
i = 0
c = 0
while 'xxx' in s:
	c = c + s.count('xxx')
	s = s.replace('xxx', 'xx')
print(c)


n = input()
str = input()
x = 0
c = 0
for l in str:
	if l == 'x':
		x = x + 1
	else:
		x = 0
		continue
	if x >= 3:
		c = c + 1
print(c)


def startchis(s):
	if len(s) > 0 and s[0] == 'x':
		return 1 + startchis(s[1:])
	return 0

def f(s):
	output = 0
	while len(s) > 0:
		m = startchis(s)
		if m == 0:
			s = s[1:]
		else:
			if m >= 3:
				output += m - 2
			s = s[m:]
	return output
n = int(input())
s = input()
print(f(s))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = []
	s = S()
	c = 0
	for x in s:
		if x == 'x':
			c += 1
		elif c > 0:
			l.append(c)
			c = 0
	if c > 0:
		l.append(c)
	ans = 0
	for x in l:
		ans += max(0, x - 2)
	return ans
print(main())


length = int(input())
filename = input()
count = 0
erase = 0
if filename[0] == 'x':
	count += 1
for i in range(1, length - 1):
	if filename[i] == 'x' and (filename[i - 1] == 'x' or filename[i + 1] == 'x'):
		count += 1
	else:
		if count >= 3:
			erase += count - 2
		count = 0
if filename[length - 1] == 'x' and count > 0:
	count += 1
if count >= 3:
	erase += count - 2
print(erase)


def solution():
	num = int(input())
	string = input()
	counter = 0
	res = ''
	if 'xxx' not in string:
		return print(0)
	for i in range(num):
		if 'xxx' in string:
			string = string.replace('xxx', 'xx', 1)
			counter += 1
	return print(counter)
solution()


def find_xxx(my_str, i):
	if my_str[i] == 'x' and my_str[i + 1] == 'x' and (my_str[i + 2] == 'x'):
		return 1
	else:
		return 0
n = int(input())
txt = input()
c = 0
for i in range(len(txt) - 2):
	if find_xxx(txt, i) == 1:
		c = c + 1
print(c)


import re
input()
print(sum((len(f) - 2 for f in re.findall('x{3,}', input()))))


a = int(input())
oop = input()
ans = 0
cnt = 0
for i in range(len(oop)):
	if oop[i] == 'x':
		cnt += 1
	else:
		if cnt > 2:
			ans += cnt - 2
		cnt = 0
if cnt > 2:
	ans += cnt - 2
print(ans)


n = int(input())
a = input().strip()
i = 0
ans = 0
while i < n:
	countX = 0
	while i < n and a[i] == 'x':
		countX += 1
		i += 1
	if countX > 0:
		ans += max(0, countX - 2)
	else:
		i += 1
print(ans)


n = int(input())
filename = input()
res = 0
for i in range(len(filename) - 2):
	xxx = True
	for j in range(3):
		if filename[i + j] != 'x':
			xxx = False
			break
	if xxx:
		res += 1
print(res)


n = int(input())
s = input()
a = 0
while 'xxx' in s:
	t = list(s)
	i = s.index('xxx')
	t.pop(i)
	s = ''.join(t)
	a += 1
print(a)


n = int(input())
b = input()
if 'xxx' not in b:
	print(0)
else:
	a = list(b)
	count = 0
	i = 2
	while i < n:
		if a[i] == a[i - 1] == a[i - 2] == 'x':
			count += 1
		i += 1
	print(count)


b = int(input())
a = input()
sum = 0
while 'xxx' in a:
	sum += 1
	c = a.find('xxx')
	a = a[:c] + a[c + 1:]
print(sum)


import re
input()
word = input()
matches = re.findall('(?=(xxx))', word)
print(len(matches))


n = int(input())
stri = input()
count = 0
i = 0
while i < n - 2:
	if stri[i] == 'x':
		if stri[i + 1] == stri[i + 2] == 'x':
			count += 1
	i += 1
print(count)


a = int(input())
b = input()
h = 0
j = 0
for i in range(a):
	if b[i] == 'x':
		h += 1
	else:
		h = 0
	if h == 3:
		j += 1
		h -= 1
print(j)


(___, s) = (input(), input())
ret = 0
for i in range(2, len(s)):
	if s[i - 2] == 'x' and s[i - 1] == 'x' and (s[i] == 'x'):
		ret += 1
print(ret)


n = int(input())
a = str(input())
k = 0
a1 = a
while a.count('xxx') != 0:
	a = a.replace('xxx', 'xx')
k = len(a1) - len(a)
print(k)


n = int(input())
s = list(input())
i = 2
p = 0
while i < n:
	if s[i - 2] == 'x' and s[i - 1] == 'x' and (s[i] == 'x'):
		j = i
		p += 1
		while j < n - 1:
			s[j] = s[j + 1]
			j += 1
		n -= 1
		i -= 1
	i += 1
print(p)


n = int(input())
s = input()
ctn = 0
smactn = 0
for c in s:
	if c == 'x':
		smactn += 1
	else:
		ctn += max(0, smactn - 2)
		smactn = 0
print(ctn + max(0, smactn - 2))


n = int(input())
name = input()
strings = []
a = 0
for x in range(n):
	if name[x] == 'x':
		a += 1
	else:
		strings.append(a)
		a = 0
strings.append(a)
strings = list(filter(lambda x: x >= 3, strings))
strings = map(lambda x: x - 2, strings)
print(sum(strings))


n = int(input())
s = input()
g = 0
aux = 0
l = []
for c in s:
	if c == 'x':
		aux += 1
	else:
		if aux >= 3:
			g += 1
			l.append(aux)
		aux = 0
if aux >= 3:
	l.append(aux)
l = map(lambda x: x - 2, l)
print(sum(l))


n = int(input())
st = input()
fl = False
c = 0
c1 = 0
for i in st:
	if i == 'x':
		c += 1
	else:
		if c >= 3:
			c1 += c - 2
		c = 0
if c >= 3:
	c1 += c - 2
print(c1)


p = input()
s = input()
ans = 0
while 'xxx' in s:
	s = s.replace('xxx', 'xx', 1)
	ans = ans + 1
print(ans)


input_number = input()
file_name = input()
x = 0
while file_name.find('xxx') != -1:
	x_index = file_name.find('xxx')
	file_name = file_name[:x_index] + file_name[x_index + 1:]
	x += 1
print(x)


try:
	n = int(input())
	a = input()
	i = 0
	coun = 0
	while i < n:
		if a[i] == 'x':
			if i < n - 2 and a[i + 1] == 'x' and (a[i + 2] == 'x'):
				coun += 1
		i += 1
	print(coun)
except:
	pass


n = int(input())
s = list(str(input()))
(ans, sum_x) = (0, 0)
for v in s:
	if v == 'x':
		sum_x += 1
	else:
		if sum_x > 2:
			ans += sum_x - 2
		sum_x = 0
if sum_x > 2:
	ans += sum_x - 2
print(ans)


n = int(input())
s = input()
if s.count('xxx') == 0:
	print(0)
else:
	a = s
	count = 0
	while a.count('xxx') != 0:
		a = a.replace('xxx', 'xx')
		count += 1
	print(len(s) - len(a))


a = 'xxx'
j = int(input())
s = input()
k = 0
count = 0
for i in range(3, j + 1):
	if s[k:i] == a:
		count += 1
	k += 1
print(count)


n = int(input())
s = input()
ans = 0
f = 0
for i in range(0, len(s)):
	if s[i] == 'x':
		f = f + 1
		if f == 3:
			ans = ans + 1
			f = f - 1
	else:
		f = 0
print(ans)


n = int(input())
s = input()
x = 0
cnt = 0
ans = 0
while x < n:
	if s[x] == 'x':
		cnt += 1
	else:
		cnt = 0
	if cnt >= 3:
		ans += 1
	x += 1
print(ans)


from collections import *
n = int(input())
chars = input()
cnt = 0
i = 0
while i < len(chars):
	if chars[i] == 'x':
		j = i
		while j < len(chars):
			if not chars[j] == 'x':
				break
			j += 1
		cnt += max(0, j - i - 2)
		i = j
	else:
		i += 1
print(cnt)


n = int(input(''))
str1 = input('')
num = 0
for i in range(1, n - 1):
	if str1[i] == 'x' and str1[i - 1] == 'x' and (str1[i + 1] == 'x'):
		num += 1
print(num)


def filename(s):
	x_s = 0
	res = 0
	for c in s:
		if c == 'x':
			x_s += 1
			if x_s > 2:
				res += 1
		else:
			x_s = 0
	print(res, end='')
input()
filename(input())


a = int(input())
b = input()
c = 0
for i in range(0, len(b) - 2):
	if b[i:i + 3] == 'xxx':
		c += 1
print(c)


def NaytiChisla(stroka):
	kek = ''
	chislo = []
	koef = 1
	for i in range(len(stroka)):
		if stroka[i] == '-':
			koef = -1
		if stroka[i] == '0' or stroka[i] == '1' or stroka[i] == '2' or (stroka[i] == '3') or (stroka[i] == '4') or (stroka[i] == '5') or (stroka[i] == '6') or (stroka[i] == '7') or (stroka[i] == '8') or (stroka[i] == '9'):
			kek += stroka[i]
		if stroka[i] == ' ':
			chislo.append(int(kek) * koef)
			koef = 1
			kek = ''
	chislo.append(int(kek) * koef)
	koef = 1
	return chislo
n = int(input())
stroka = str(input())
k = 0
for i in range(0, len(stroka) - 2):
	if stroka[i] == 'x' and stroka[i + 1] == 'x' and (stroka[i + 2] == 'x'):
		k += 1
		i += 2
print(k)


n = int(input())
(c, o) = (0, 0)
for i in input():
	if i == 'x':
		c += 1
	else:
		c = 0
	if c >= 3:
		o += 1
print(o)


n = int(input())
s = input()
t = -2
c = 0
for i in range(0, n):
	if s[i] == 'x':
		t += 1
	elif t > 0:
		c += t
		t = -2
	else:
		t = -2
if t > 0:
	c += t
print(c)


n = int(input())
l = list(input())
count = 0
for i in range(n - 2):
	if l[i] == l[i + 1] == l[i + 2] == 'x':
		count += 1
print(count)


size = int(input())
filename = input()

def eliminateX(s):
	position = s.index('xxx')
	return s[:position] + s[position + 1:]
if 'xxx' not in filename:
	print('0')
else:
	omit = 0
	while 'xxx' in filename:
		filename = eliminateX(filename)
		omit += 1
	print(omit)


def CountOccurrences(string, substring):
	count = 0
	start = 0
	while start < len(string):
		flag = string.find(substring, start)
		if flag != -1:
			start = flag + 1
			count += 1
		else:
			return count
input()
string = input()
print(CountOccurrences(string, 'xxx'))


numero = input()
numero = int(numero)
if numero >= 3 and numero <= 100:
	string = input()
	string = str(string)
	if len(string) == numero:
		a = ''
		cont = 0
		for i in string:
			if i == 'x':
				a += i
				if a == 'xxx':
					a = a[:len(a) - 1]
					cont += 1
			else:
				a = ''
		print(cont)


n = int(input())
file_name = input()
temp = 0
result = 0
i = 0
while i < len(file_name):
	if file_name[i] != 'x':
		temp = 0
	else:
		temp += 1
		if temp == 3:
			file_name = file_name[:i] + file_name[i + 1:]
			temp = 0
			result += 1
			i -= 3
	i += 1
print(result)


n = int(input())
s = input()
i = 0
xs = 0
delX = 0
if s.find('xxx') >= 0:
	while i < n:
		if s[i] == 'x':
			xs += 1
			if xs >= 3:
				delX += 1
		else:
			xs = 0
		i += 1
	print(delX)
else:
	print('0')


n = int(input())
s = input()
s = [s[i] for i in range(n)]
prv = 0
for i in range(n):
	if s[i] == 'x' and prv < 2:
		prv += 1
	elif s[i] == 'x' and prv >= 2:
		s[i] = -1
	elif prv > 0:
		prv = 0
print(s.count(-1))


n = input()
s = input()
k = 0
while s.count('xxx'):
	k += 1
	s = s.replace('xxx', 'xx', 1)
print(k)


x = int(input())
str = input()
i = 0
remove = 0
while i < x - 2:
	if str[i] == 'x' and str[i + 1] == 'x' and (str[i + 2] == 'x'):
		remove += 1
	i += 1
print(remove)


n = int(input())
mylist = input()
ans = 0
temp = 0
for i in range(len(mylist)):
	if mylist[i] == 'x':
		if temp < 2:
			temp += 1
		else:
			ans += 1
	else:
		temp = 0
print(ans)


def main():
	n = int(input())
	line = input()
	now = 0
	ans = 0
	for i in range(n):
		if line[i] == 'x':
			now += 1
		else:
			ans += max(now - 2, 0)
			now = 0
	ans += max(now - 2, 0)
	now = 0
	print(ans)
main()


n = int(input())
s = input()
c = 0
for i in range(n):
	if s.startswith('xxx', i):
		c = c + 1
print(c)


import math
n = int(input())
s = str(input())
k = 0
ans = 0
for i in range(len(s)):
	if s[i] == 'x':
		k += 1
	else:
		if k >= 3:
			ans += k - 2
		k = 0
if k >= 3:
	ans += k - 2
print(ans)


n = int(input())
st = input()
ans = 0
for i in range(1, n - 1):
	if st[i] == 'x' and st[i - 1] == 'x' and (st[i + 1] == 'x'):
		ans += 1
print(ans)


n = int(input())
s = str(input())
num = 0
while 'xxx' in s:
	s = list(s)
	for i in range(0, n - 2):
		if s[i] == 'x' and s[i + 1] == 'x' and (s[i + 2] == 'x'):
			s = s[0:i + 1] + s[i + 2:len(s)]
			s = ''.join(s)
			num += 1
			break
print(num)


n = int(input())
a = list(input())
ct = 0
sum = 0
for k in range(1, len(a)):
	if a[k] == 'x' and a[k - 1] == 'x':
		if ct == 0:
			ct = 2
		else:
			ct += 1
	else:
		if ct >= 3:
			sum += ct - 2
		ct = 0
if ct >= 3:
	sum += ct - 2
print(sum)


n = int(input())
s = input()
i = 0
sum1 = 0
while i < len(s):
	if s[i] == 'x':
		count = 0
		while i < len(s) and s[i] == 'x':
			count += 1
			i += 1
		if count >= 3:
			sum1 += count - 2
	else:
		i += 1
print(sum1)


n = int(input())
input_str = input()
count = 0
for i in range(len(input_str) - 2):
	if input_str[i:i + 3] == 'xxx':
		count += 1
print(count)


n = int(input())
s = input()
num = 0
a = []
for i in range(n):
	if s[i] == 'x':
		num += 1
	else:
		a.append(num)
		num = 0
a.append(num)
b = list(filter(lambda x: x >= 3, a))
print(sum(b) - 2 * len(b))


length = int(input())
s = input()
count = 0
for i in range(length - 2):
	if s[i:i + 3] == 'xxx':
		count += 1
print(count)


import collections

def solve(n, string):
	xCount = 0
	ans = 0
	for ch in string:
		if ch == 'x':
			xCount += 1
		else:
			xCount = 0
		if xCount >= 3:
			ans += 1
	return ans
n = int(input().strip())
string = input().strip()
print(solve(n, string))


n = int(input())
s = str(input())
k = s[:]
l = len(k)
count = 0
for i in range(n):
	if k[i:i + 3] == 'xxx':
		k.replace(k[i + 1], '')
		count += 1
	else:
		continue
print(count)


n = int(input())
s = input() + ' ' * (n % 3)
cnt = 0
for x in range(n):
	if s[x:x + 3] == 'xxx':
		cnt += 1
print(cnt)


n = int(input())
s = input()
xn = []
x = 0
for i in s:
	if i != 'x':
		xn.append(x)
		x = 0
	else:
		x += 1
xn.append(x)
r = 0
for j in xn:
	if j >= 3:
		r += j - 2
print(r)


import sys

def main():
	n = int(input())
	s = input()
	(i, j) = (0, 0)
	ret = 0
	while i < n:
		if s[i] != 'x':
			i += 1
			continue
		j = i
		while True:
			if j == n - 1 or s[j + 1] != 'x':
				break
			j += 1
		ret += 0 if j - i < 2 else j - i - 1
		i = j + 1
	print(ret)
main()


a = b = 0
c = int(input())
for i in str(input()):
	if i == 'x':
		a += 1
	if i != 'x':
		a = 0
	if a >= 3:
		b += 1
print(b)


n = int(input())
line = input()
while 'xxx' in line:
	temp = list(line)
	temp.pop(line.index('xxx'))
	line = ''.join(temp)
print(n - len(line))


n = int(input())
s = input()
c = 0
while 'xxx' in s:
	v = s.index('xxx')
	s = s[:v] + s[v + 1:]
	c += 1
print(c)


n = int(input())
s = input()
l = []
for a in s:
	l.append(a)
counter = 0
number = 0
for i in l:
	if i == 'x':
		counter += 1
		if counter == 3:
			number += 1
			counter -= 1
			continue
	else:
		counter = 0
print(number)


n = int(input())
string = input()
(x_count, soln) = (0, 0)
for s in string:
	if s == 'x':
		x_count += 1
	else:
		x_count = 0
	if x_count >= 3:
		soln += 1
print(soln)


n = input()
a = input()
a = a + 'd'
d = 0
e = 0
for x in range(0, len(a)):
	if a[x] == 'x':
		d = d + 1
	elif d > 2:
		e = e + d - 2
		d = 0
	else:
		d = 0
		continue
print(e)


import os
import sys

def validName(fname):
	count = 0
	while fname.find('xxx') != -1:
		temp_str = fname[:fname.find('xxx')] + fname[fname.find('xxx') + 1:]
		fname = temp_str
		count += 1
	print(count)
n = input()
s = input()
validName(s)


n = int(input())
s = input()[:n]
if set(list(s)) == {'x'}:
	print(n - 2)
else:
	c = 0
	while s.count('xxx') > 0:
		c += s.count('xxx')
		s = s.replace('xxx', 'xx')
	print(c)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7

def RLE(data):
	from itertools import groupby
	return [(x, len(list(grp))) for (x, grp) in groupby(data)]
N = INT()
S = input()
lre = RLE(S)
ans = 0
for (s, cnt) in lre:
	if s == 'x':
		ans += max(cnt - 2, 0)
print(ans)


n = int(input())
s = input() + '0'
d = 1001 * [0]
ans = []
i = 1
x = 0
for t in range(1, n + 1):
	if s[t] == 'x' and s[t - 1] == 'x':
		i += 1
	else:
		if s[t - 1] == 'x':
			ans.append(i)
		i = 1
for t in range(len(ans)):
	if ans[t] >= 3:
		x += ans[t] - 2
print(x)


n = int(input())
name = input().strip()
n_steps = 0
curr = ''
for j in name:
	if j == 'x':
		curr += 'x'
	else:
		if len(curr) >= 3:
			n_steps += len(curr) - 2
		curr = ''
if len(curr) >= 3:
	n_steps += len(curr) - 2
print(n_steps)


number = int(input())
file_name = input()
counter = 0
counter_x = 0
for i in range(number):
	if file_name[i] == 'x':
		counter_x += 1
	else:
		counter_x = 0
	if counter_x >= 3:
		counter += 1
print(counter)


h = int(input())
st = input()
(d, d1, count) = (dict(), dict(), 0)
d['x'] = 3
for i in range(3):
	d1[st[i]] = d1.get(st[i], 0) + 1
if d1 == d:
	count += 1
for i in range(1, h - 2):
	d1[st[i - 1]] -= 1
	if d1[st[i - 1]] == 0:
		del d1[st[i - 1]]
	if d1.get(st[i + 2]):
		d1[st[i + 2]] += 1
	else:
		d1[st[i + 2]] = d1.get(st[i + 2], 0) + 1
	if d1 == d:
		count += 1
print(count)


n = int(input())
s = ''.join(map(lambda x: str(int(x == 'x')), list(input()))).split('0')
s = sum((len(x) - 2 for x in s if len(x) > 2))
print(s)


n = int(input())
str = input()
result = 0
prev = None
cnt = 0
for item in str:
	if item == 'x':
		cnt += 1
	else:
		cnt = 0
	if cnt >= 3:
		result += 1
print(result)


no = int(input())
count = 0
ss = input()
for i in range(1, no - 1):
	if ss[i - 1] + ss[i] + ss[i + 1] == 'xxx':
		count += 1
print(count)


n = int(input())
string = input()
i = 0
count = 0
while True:
	if i > n - 3:
		break
	if string[i] == 'x':
		for j in range(i, i + 3):
			if string[j] != 'x':
				i = j + 1
				break
		if j == i + 2:
			count += 1
			i += 1
	else:
		i += 1
print(count)


n = input()
a = input()
m = 0
if 'xxx' not in a:
	print('0')
	exit()
while 1:
	if 'xxx' in a:
		b = a.count('xxx')
		a = a.replace('xxx', 'xx')
		m += b
	else:
		print(m)
		exit()


def removed_character(f_name):
	x_count = 0
	del_count = 0
	for i in f_name:
		if i == 'x':
			x_count += 1
		if i != 'x':
			x_count = 0
		if x_count >= 3:
			del_count += 1
	return del_count
n = int(input())
f_name = input()
res = removed_character(f_name)
print(res)


n = int(input())
str = input()
i = 0
set = False
count = 0
ans = 0
while i <= n:
	if i == n or (i < n and str[i] != 'x'):
		set = False
		if count >= 2:
			ans += count - 2
		count = 0
	elif str[i] == 'x':
		set = True
		count += 1
	i += 1
print(ans)


n = int(input())
name = input()
count = 0
ans = 0
for i in range(n):
	if name[i] != 'x':
		count = 0
	else:
		count += 1
		if count > 2:
			ans += 1
print(ans)


a = int(input())
w = input()
p = 'xxx'
res = [i for i in range(len(w)) if w.startswith(p, i)]
print(len(res))


N = int(input())
ch = str(input())
ans = ''
Ans = 0
for i in range(N):
	if ch[i] == 'x':
		ans += 'x'
	elif len(ans) > 2:
		Ans += len(ans) - 2
		ans = ''
	elif ch[i] != 'x':
		ans = ''
	if i == N - 1 and len(ans) > 2:
		Ans += len(ans) - 2
print(Ans)


import sys
from functools import reduce
from collections import Counter
import time
import datetime
import math

def ip():
	return int(sys.stdin.readline())

def sip():
	return input()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.insert(i, arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = ip()
s = sip()
count = 0
for i in range(2, n):
	if s[i - 2] == 'x' and s[i - 1] == 'x' and (s[i] == 'x'):
		count += 1
print(count)


a = int(input())
b = input()
c = []
for i in range(a):
	if i == 0:
		if b[i] == 'x':
			c.append(1)
		else:
			c.append(0)
	elif b[i] == 'x':
		c[-1] += 1
	elif b[i] != 'x' and b[i - 1] == 'x':
		c.append(0)
if c[-1] == 0:
	c.pop(-1)
ans = 0
for i in range(len(c)):
	if c[i] >= 2:
		ans += c[i] - 2
print(ans)


n = int(input())
a = input()
k = 0
f = 0
for i in a:
	if i == 'x':
		k += 1
	else:
		if k > 2:
			f += k - 2
		k = 0
if k != 0:
	if k > 2:
		f += k - 2
print(f)


n = int(input())
s = str(input())
countx = 0
res = 0
for i in s:
	if i == 'x':
		countx += 1
	elif countx >= 3:
		res += countx - 2
		countx = 0
	else:
		countx = 0
if countx >= 3:
	res += countx - 2
print(res)


import re
n = int(input())
s = input()
lst = re.findall('xxx+', s)
sum = 0
for i in lst:
	sum = sum + (len(i) - 2)
print(sum)


n = int(input())
s = input()
a = ''
num = 0
for item in s:
	if item == 'x':
		num += 1
	else:
		num = 0
	if num < 3:
		a += item
print(n - len(a))


n = int(input())
res = 0
tmp = 0
for i in input():
	if i == 'x':
		tmp += 1
	else:
		if tmp > 2:
			res += tmp - 2
		tmp = 0
if tmp > 2:
	res += tmp - 2
print(res)


length = input()
str = input()
res = 0
for i in range(2, len(str)):
	if str[i - 2] == 'x' and str[i - 1] == 'x' and (str[i] == 'x'):
		res += 1
print(res)


from math import sqrt

def main():
	n = int(input())
	s = input()
	res = [s[0]]
	s = s[1:]
	while s != '':
		if res[-1][-1] == s[0]:
			res[-1] = res[-1] + s[0]
		else:
			res.append(s[0])
		s = s[1:]
	print(sum([len(d) - 2 for d in res if d[0] == 'x' and len(d) > 2]))
main()


from itertools import groupby
n = int(input())
A = input()
result = 0
for (c, g) in groupby(A):
	if c == 'x':
		result += max([0, len(list(g)) - 2])
print(result)


input()
x = input()
ans = 0
cnt = 0
for i in x:
	if i == 'x':
		cnt += 1
		if cnt == 3:
			ans += 1
			cnt -= 1
	else:
		cnt = 0
print(ans)


n = int(input())
a = list(input())
t = []
p = 0
w = 0
if set(a) == {'x'}:
	print(len(a) - 2)
elif 'x' not in a:
	print(0)
else:
	for i in range(len(a)):
		if a[i] == 'x':
			p += 1
		elif a[i] != 'x':
			if p > 2:
				t.append(p - 2)
			p = 0
			O = i
			w += 1
	if w > 0:
		if len(a[O + 1:]) > 2:
			t.append(len(a[O + 1:]) - 2)
	print(sum(t))


n = int(input())
s = input()
if not 'xxx' in s:
	print(0)
else:
	cnt = 0
	for i in range(len(s) - 2):
		if s[i] == s[i + 1] == s[i + 2] == 'x':
			cnt += 1
	print(cnt)


n = int(input())
global sr
sr = input()
count = 0

def sol():
	global sr, count
	if 'xxx' in sr:
		pos = sr.find('xxx')
		sr = sr[:pos] + sr[pos + 1:]
		count = count + 1
		sol()
	return
sol()
print(count)


n = int(input())
word = input()
count = 0
ans = 0
for i in word:
	if i == 'x':
		count += 1
	else:
		if count >= 3:
			ans = ans + (count - 2)
		count = 0
if count >= 3:
	ans = ans + (count - 2)
print(ans)


_ = int(input())
s = input()
idx = s.find('xxx')
n = 0
while idx != -1:
	s = s[:idx] + s[idx + 1:]
	idx = s.find('xxx')
	n += 1
print(n)


input()
s = t = 0
for q in input() + ' ':
	if q == 'x':
		s += 1
	else:
		(s, t) = (0, t + max(s - 2, 0))
print(t)


n = int(input())
a = input()
i = 0
ans = []
while i < n:
	if a[i] == 'x':
		count = 1
		i += 1
		while i < n and a[i] == 'x':
			count += 1
			i += 1
		ans.append(count)
		continue
	else:
		i += 1
new = 0
for i in ans:
	if i > 2:
		new += i - 2
print(new)


z = int(input())
n = input()
s = 0
p = 0
for i in range(len(n)):
	if n[i] == 'x':
		s = s + 1
		if s > 2:
			p = p + 1
	else:
		s = 0
print(p)


import math
import os
import random
import re
from sys import stdin, stdout
from collections import Counter
from itertools import permutations

def si():
	return str(stdin.readline())

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def debug(x):
	return stdout.write(str(x))
n = int(input())
a = input()
k = 0
for i in range(n - 2):
	if a[i] + a[i + 1] + a[i + 2] == 'xxx':
		k += 1
print(k)


import sys
n = int(input())
string = input()
prevx = 0
result = 0
for c in string:
	if c == 'x':
		prevx = prevx + 1
	else:
		if prevx > 2:
			result = result + prevx - 2
		prevx = 0
if prevx > 2:
	result = result + prevx - 2
print(result)


n = int(input())
m = list(input())
a = []
for i in range(n - 2):
	if m[i] + m[i + 1] + m[i + 2] == 'xxx':
		a.append(1)
print(len(a))


n = eval(input())
mkd = []
arr = input()
loc = 0
ans = 0
for x in arr:
	if x == 'x':
		loc = loc + 1
		if loc > 2:
			ans = ans + 1
	else:
		loc = 0
print(ans)


import math
k = input()
n = input()
count = 0
for i in range(len(n) - 2):
	if n[i:i + 3] == 'xxx':
		count += 1
print(count)


input()
x = input()
i = 0
while 1:
	if 'xxx' in x:
		x = x.replace('xxx', 'xx', 1)
		i += 1
	elif 'xxx' not in x:
		break
print(i)


n = int(input())
s = input()
c = 0
for (i, j) in enumerate(s):
	if s[i:i + 3] == 'xxx':
		c += 1
print(c)


from sys import stdin

def iinput():
	return int(stdin.readline())

def sinput():
	return input()

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
n = iinput()
s = list(sinput())
ans = 0
i = 0
while i < len(s):
	if s[i] == 'x':
		if s[i - 2:i + 1] == ['x', 'x', 'x']:
			s.pop(i)
			ans += 1
		else:
			i += 1
	else:
		i += 1
print(ans)


n = int(input())
word = input().strip()
ans = 0
for i in range(n):
	if i > 1 and word[i] == word[i - 1] == word[i - 2] == 'x':
		ans += 1
print(ans)


n = int(input())
name = input()
xs = 0
delcount = 0
for x in name:
	if x == 'x' and xs < 2:
		xs += 1
	elif x == 'x':
		delcount += 1
	else:
		xs = 0
print(delcount)


n = int(input())
s = input()
(z, count) = (0, 0)
for x in range(n):
	if s[x] == 'x':
		count += 1
	else:
		count = 0
	if count == 3:
		z += 1
		count = 2
print(z)


i = int(input())
x = input()
c = 0
arr = []
for l in range(i):
	if x[l] == 'x':
		c += 1
	if x[l] != 'x':
		arr.append(c)
		c = 0
	if l == i - 1 and x[l] == 'x':
		arr.append(c)
sans = 0
for g in range(len(arr)):
	if arr[g] > 2:
		sans = sans + arr[g] - 2
print(sans)


n = int(input())
x = input()
x = x + 'asd'
c = 0
l = []
for i in range(len(x)):
	if x[i] == 'x' and x[i + 1] == 'x':
		c += 1
	else:
		c = 0
	l.append(c)
b = []
for i in range(len(l) - 1):
	if l[i + 1] == 0:
		b.append(l[i])
b.append(l[-1])
d = 0
for i in b:
	if i >= 2:
		d += i - 1
print(d)


n = int(input())
s = input()
l = 0
t = 0
for c in s:
	if c == 'x':
		l += 1
	elif l != 0:
		if l >= 3:
			t += l - 2
		l = 0
if l != 0 and l >= 3:
	t += l - 2
print(t)


n = int(input())
l = list(input())
l.append('#')
cvb = 0
loc = 'tap'
say = 0
for i in range(len(l)):
	if l[i] == 'x' and loc == 'tap':
		loc = 'var'
	if l[i] == 'x' and loc == 'var':
		say += 1
	if loc == 'var' and l[i] != 'x' or l[i] == '#':
		loc = 'tap'
		say = say - 2
		if say > 0:
			cvb += say
		say = 0
print(cvb)


from collections import deque

def get_res(N, s):
	cnt = 0
	res = 0
	i = 0
	while i < N - 2:
		if s[i:i + 3] == 'xxx':
			j = i + 2
			while j < N and s[j] == 'x':
				j += 1
				res += 1
			i = j
		else:
			i += 1
	return res
N = int(input())
s = input()
result = get_res(N, s)
print('{}'.format(result))


n = int(input())
s = input()
l = [s[i:j + 1] for i in range(0, n) for j in range(i, n)]
c = 0
f = 1
for i in l:
	if i == 'xxx':
		f = 0
		c = c + 1
if f == 1:
	print(0)
else:
	print(c)


n = int(input())
s = str(input())
count = 0
for i in range(n - 2):
	if s[i:i + 3] == 'xxx':
		count += 1
print(count)


tamanho = int(input())
lista = list(input())
excesso = 0
i = 0
while i <= tamanho:
	contagem = 0
	j = i
	while j < tamanho and lista[j] == 'x':
		contagem += 1
		if contagem > 2:
			excesso += 1
		j += 1
	if i == j:
		i += 1
	else:
		i = j
print(excesso)


n = int(input())
s = input().strip()
total = 0
while s.find('xxx') >= 0:
	s = s.replace('xxx', 'xx', 1)
	total += 1
print(total)


import sys
data = sys.stdin.readlines()
filtered_data = data[1].split()
d = filtered_data[0]
if 'xxx' not in d:
	print(0)
else:
	p = 0
	for i in range(len(d) - 2):
		if d[i] == d[i + 1] == d[i + 2] == 'x':
			p += 1
	print(p)


n = int(input())
s = input()
m = 0
c = 0
for i in range(n):
	if s[i] == 'x':
		m = m + 1
	else:
		if m > 2:
			c = c + m - 2
		m = 0
if s[n - 1] == 'x':
	if m > 2:
		c = c + m - 2
print(c)


n = int(input())
s = input()
cnt = 0
for i in range(n, 2, -1):
	if 'x' * i in s:
		cnt += s.count('x' * i) * (len('x' * i) - 2)
		s = s.replace('x' * i, '')
print(cnt)


n = int(input())
s = input()
found_at = s.find('xxx')
if found_at == -1:
	print(0)
	exit()
d = {}
longest_conse = 0
curr = 0
prev = ''
for x in s:
	if x == 'x' and prev != 'x':
		if curr not in d:
			d[curr] = 1
		else:
			d[curr] += 1
		curr = 1
	elif x == 'x' and prev == 'x':
		curr += 1
	longest_conse = max(longest_conse, curr)
	prev = x
if curr not in d:
	d[curr] = 1
else:
	d[curr] += 1
del_items = 0
for (k, v) in d.items():
	if k > 2:
		del_items += (k - 2) * v
print(del_items)


input()
s = input()
ans = 0
while s.count('xxx'):
	i = s.find('xxx')
	s = s[:i] + s[i + 1:]
	ans += 1
print(ans)


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
Read = lambda : list(map(int, input().split()))
Num = lambda : int(input())
exec("try:sys.stdin=open('in.txt','r');sys.stdout=open('out.txt','w')\nexcept:pass")

def solve():
	n = Num()
	s = input()
	(x, ans) = (1, 0)
	for i in range(1, len(s)):
		if s[i] + s[i - 1] == 'xx':
			x += 1
		else:
			x = 1
		if x >= 3:
			ans += 1
	print(ans)
solve()


n = int(input())
arr = input()
count = 0
for (i, arri) in enumerate(arr):
	if arr[i:i + 3] == 'xxx':
		count = count + 1
print(count)


import re
n = int(input())
s = input()
l = 0
for x in re.findall('[x]{3,}', s):
	l += len(x) - 2
print(l)


n = int(input())
s = input()
sub = 'xxx'
res = 0
for i in range(n - 2):
	res = res + s.count(sub, i, i + 3)
print(res)


def find_all_substrings(string, substring):
	index = 0
	length = len(string)
	occurences = []
	while index < length:
		i = string.find(substring, index, length)
		if i == -1:
			return occurences
		occurences.append(i)
		index = i + 1
	return occurences
n = int(input())
file_name = input()
count = len(find_all_substrings(file_name, 'xxx'))
if count == 0:
	print(0)
else:
	print(count)


N = int(input())
L = input()
j = 0
c = []
count = 0
for i in range(N):
	if L[i] != 'x':
		if count >= 3:
			c.append(count)
		count = 0
	else:
		count += 1
if count >= 3:
	c.append(count)
c = [p - 2 for p in c]
print(sum(c))


num = input()
name = input()
i = 0
count = 0
while i < len(name) - 2:
	if name[i] == 'x' and name[i + 1] == 'x' and (name[i + 2] == 'x'):
		name = name[:i + 2] + name[i + 3:]
		i -= 1
		count += 1
	i += 1
print(count)


a = input()
a = input() + 'a'
consecutive_x = 0
delete = 0
for i in range(len(a)):
	if a[i] != 'x':
		if consecutive_x > 2:
			delete += consecutive_x - 2
		consecutive_x = 0
	else:
		consecutive_x += 1
print(delete)