b = 0
w = 0
c = 0
ans = 0
n = int(input())
s = input()
for i in range(n):
    if s[i]=="#":
        b+=1
    elif s[i]==".":
        w+=1

if b>=w:
    for i in range(n):
        if s[i]=="#":
            c = i
            break
    ans = w-c
    
if b<w:
    ans = b

print(ans)
