n = int(input())
s = input()
tmp1 = 0
tmp2 = 0
sharp = 0
dot = 0
sharp2 = 0
dot2 = 0
for i in range(1, n + 1):
    if s[-i] == "#":
        tmp1 += 1
    else:
        break
for i in range(1, n + 1):
    if s[-i] == ".":
        tmp2 += 1
    else:
        break
# print(s[:n-tmp1])
# print(tmp1)
for i in s:
    if i == "#":
        sharp += 1
    if i == ".":
        dot += 1
for i in s[:n - tmp1]:
    if i == "#":
        sharp2 += 1
    if i == ".":
        dot2 += 1
print(min(sharp, dot, sharp2, dot2))