N = int(eval(input()))

S = eval(input())

w = S.count('.')



ans = 10**9

cost = 0

for s in S:

    w -= s == '.'

    ans = w + cost if w + cost< ans else ans

    cost += s == '#'

print(ans)
_ = int(eval(input()))

S = eval(input())

ans = 10**9

cost = S.count('.')

for s in S:

    cost -= s == '.'

    ans = cost if cost< ans else ans

    cost += s == '#'

print(ans)
N = int(eval(input()))
S = eval(input())
w = S.count(".")
ans = 10**9
cost = 0
for s in S:
    w -= s == "."
    ans = w + cost if w + cost < ans else ans
    cost += s == "#"
print(ans)

_ = int(eval(input()))
S = eval(input())
ans = 10**9
cost = S.count(".")
for s in S:
    cost -= s == "."
    ans = cost if cost < ans else ans
    cost += s == "#"
print(ans)

-N = int(eval(input())) +_ = int(eval(input())) -w = S.count(".") -cost = 0 +cost = S.count(".") -    w -= s == "." -    ans = w + cost if w + cost < ans else ans +    cost -= s == "." +    ans = cost if cost < ans else ans