# coding: utf-8
# Your code here!
N=int(input())
S=list(input())

turn=0
kuro=0
shiro=0

ans=0
for index,item in enumerate(S):
    if item==".":
        kuro+=1
    else:
        shiro+=1
    
    if kuro>shiro:
        turn=index
        ans=shiro-kuro

print(ans+kuro)

