n = int(input())
s = input()
dst1 = 0
dst2 = 0
first_kuro = False
for c in s:
    if first_kuro:
        if c == ".":
            dst1 += 1
    if c == "#":
        first_kuro = True
first_siro = False
for c in reversed(s):
    if first_siro:
        if c == "#":
            dst2 += 1
    if c == ".":
        first_siro = True
print(min(dst1,dst2))