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


a=s.find('#');b=s.rfind('.')

if a<b:
    c=s[a:b+1].count('#');d=s[a:b+1].count('.')
    ans=min(c,d)
else:
    ans=0

l=[]
for i in range(n):
    if s[i]=='.':
        l.append(i)

y=s[l[0]+1:].count('.')
for i in range(len(l)):
    x=s[:l[i]].count('#')
    ans=min(ans,x+y)
    y-=1
print(ans)