n = int(input())
s = list(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)
