n = int(eval(input()))

s = list(eval(input()))



rd = 0

for e in s:

    if e == ".":

        rd += 1



ls = 0

res = rd

for e in s:

    if e == ".":

        rd -= 1

    else:

        ls += 1

    res = min(res, rd + ls)



print(res)

n = int(eval(input()))

s = list(eval(input()))



rd = 0

for e in s:

    if e == ".":

        rd += 1



res = rd

for e in s:

    if e == ".":

        rd -= 1

    else:

        rd += 1

    res = min(res, rd)



print(res)

n = int(eval(input()))
s = list(eval(input()))
rd = 0
for e in s:
    if e == ".":
        rd += 1
ls = 0
res = rd
for e in s:
    if e == ".":
        rd -= 1
    else:
        ls += 1
    res = min(res, rd + ls)
print(res)

n = int(eval(input()))
s = list(eval(input()))
rd = 0
for e in s:
    if e == ".":
        rd += 1
res = rd
for e in s:
    if e == ".":
        rd -= 1
    else:
        rd += 1
    res = min(res, rd)
print(res)

-ls = 0 -        ls += 1 -    res = min(res, rd + ls) +        rd += 1 +    res = min(res, rd)