n = int(input())
s = input()
start = 0
ans1 = 0
ans2 = 0
re = ""
for i in range(len(s)):
    re += s[-i-1]
for i in re:
    if start != 0 or i != "#":
        start = 1
    if start == 1 and i == ".":
        ans1 += 1
for i in range(len(s)):
    if s[i] == "#":
        ans2 += 1
print(min(ans1, ans2))
