N=eval(input())

S=input()

L=[0]



for i,x in enumerate(S):

	if x=="#":

		L.append( L[-1]+1 )

	else:

		L.append( L[-1] )

			



ans=float("inf")

for i in range(N+1):

	b=L[i]	# black on left

	w=N-i-(L[-1]-L[i])

	ans=min(ans , b+w)



print(ans)
N=eval(input())

S=input()

L=[0]



for i,x in enumerate(S):

	if x=="#":

		L.append( L[-1]+1 )

	else:

		L.append( L[-1] )

			



ans=float("inf")

for i in range(N+1):

	b=L[i]			# black on left

	w=N-i-(L[-1]-L[i])	# white on right

	ans=min(ans , b+w)



print(ans)
N = eval(input())
S = input()
L = [0]
for i, x in enumerate(S):
    if x == "#":
        L.append(L[-1] + 1)
    else:
        L.append(L[-1])
ans = float("inf")
for i in range(N + 1):
    b = L[i]  # black on left
    w = N - i - (L[-1] - L[i])
    ans = min(ans, b + w)
print(ans)

N = eval(input())
S = input()
L = [0]
for i, x in enumerate(S):
    if x == "#":
        L.append(L[-1] + 1)
    else:
        L.append(L[-1])
ans = float("inf")
for i in range(N + 1):
    b = L[i]  # black on left
    w = N - i - (L[-1] - L[i])  # white on right
    ans = min(ans, b + w)
print(ans)

-    w = N - i - (L[-1] - L[i]) +    w = N - i - (L[-1] - L[i])  # white on right