import math
 
#n=list(map(int,input().split()))
#x=int(input())
n=int(input())
s=input()
count=0
f=False
for a in range(len(s)):
    if f==True and s[a]==".":
        count+=1
    if s[a]=="#":
        f=True
count2=0
for a in range(len(s)-1):
    if s[a]=="#":
        count2+=1
print(min([count,count2]))