n = int(input())
s = input()
cnt_w, cnt_b = 0, 0
for i in range(n):
    if s[i] == "#":
        for j in range(i, n):
            if s[j] == ".":
                cnt_w += 1
        break
for i in range(n - 1, -1, -1):
    if s[i] == ".":
        for j in range(i, -1, -1):
            if s[j] == "#":
                cnt_b += 1
        
        break
print(min(cnt_w, cnt_b))
