n=int(input())
s=input()
w='.'
b='#'
ans=[]
for i in range(n):
    if b==s[i]:
        cnt=0
        cnt+=s[:i].count(b)
        cnt+=s[i:].count(w)
        ans+=[cnt]
print(0 if ans==[] else min(ans))