n=int(input())
s=list(input())

b=s.count('#')
#w=s.count('.')

ans=0
flag=False
for i in range(n):
    if flag == True and s[i] == '.':
        ans+=1
    elif s[i] == '#':
        flag=True
    elif ans>=b:
        break

#print(min(b,w))
print(min(b,ans))
