n = int(input())
#inputs = [i for i in input()]
inputs = input()

red = inputs.count('X')
blue = n - red

result = 0
br = False

i = 3
while True:
	if i**2 <= red:
		result += 1
		br = True
	if i**2 <= blue:
		result += 1
		br = True 
	temp = i**2 - (i-2)**2
	if temp <= blue and i**2 - temp <= red:
		result += 1
		br = True

	if temp <= red and i**2 - temp <= blue:
		result += 1
		br = True
	if br:
		print(result)
		break
	i += 1
