n=int(input())
s=input()
w=0
b=0
c=0
for i in range(n):
    if s[i]=='#':
        c=i
        break
for i in range(c,n):
    if s[i]=='.':
        w+=1
s=s[::-1]
for i in range(n):
    if s[i]=='.':
        c=i
        break
for i in range(c,n):
    if s[i]=='#':
        b+=1
if b<w:
    print(b)
else:
    print(w)