n = int(input())
s = input()

l = 0
r = n
for i in range(n):
    if s[i] == "#":
        l = i
        break
    
for i in range(n):
    if s[i] == ".":
        r = i+1

s = s[l:r]
b = 0
w = 0
for si in s:
    if si == "#":
        b += 1
    else:
        w += 1

print(min(b, w))