import sys

sys.setrecursionlimit(10**7)

input = sys.stdin.readline

INF = float('inf')

MOD = 10**9+7



n = int(eval(input()))

S = eval(input())

W = [0]*(2*10**5+1)

B = [0]*(2*10**5+1)

for i in range(n):

    if S[i] == '.':

        W[i] = 1

    else:

        B[i] = 1

for i in range(1,2*10**5+1):

    W[i] += W[i-1]

    B[i] += B[i-1]

W = [0] + W

B = [0] + B

res = INF

for i in range(2*10**5+1):

    ans = W[-1]-W[i]+B[i]

    if ans <= res:

        res = ans

print(res)

n = int(eval(input()))

S = eval(input())

b = 0

w = S.count('.')

res = w

for s in S:

	if s == '.':

		w -= 1

	else:

		b += 1

	res = min(res,b+w)

print(res)

	
import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")
MOD = 10**9 + 7
n = int(eval(input()))
S = eval(input())
W = [0] * (2 * 10**5 + 1)
B = [0] * (2 * 10**5 + 1)
for i in range(n):
    if S[i] == ".":
        W[i] = 1
    else:
        B[i] = 1
for i in range(1, 2 * 10**5 + 1):
    W[i] += W[i - 1]
    B[i] += B[i - 1]
W = [0] + W
B = [0] + B
res = INF
for i in range(2 * 10**5 + 1):
    ans = W[-1] - W[i] + B[i]
    if ans <= res:
        res = ans
print(res)

n = int(eval(input()))
S = eval(input())
b = 0
w = S.count(".")
res = w
for s in S:
    if s == ".":
        w -= 1
    else:
        b += 1
    res = min(res, b + w)
print(res)

-import sys - -sys.setrecursionlimit(10**7) -input = sys.stdin.readline -INF = float("inf") -MOD = 10**9 + 7 -W = [0] * (2 * 10**5 + 1) -B = [0] * (2 * 10**5 + 1) -for i in range(n): -    if S[i] == ".": -        W[i] = 1 +b = 0 +w = S.count(".") +res = w +for s in S: +    if s == ".": +        w -= 1 -        B[i] = 1 -for i in range(1, 2 * 10**5 + 1): -    W[i] += W[i - 1] -    B[i] += B[i - 1] -W = [0] + W -B = [0] + B -res = INF -for i in range(2 * 10**5 + 1): -    ans = W[-1] - W[i] + B[i] -    if ans <= res: -        res = ans +        b += 1 +    res = min(res, b + w)