n=int(input())
s=input().rstrip()
s=[i for i in s]
count=0
prevhash=0
nextdot=0
countdot=0
counthash=0
countboth=0
ans=min(s.count('.'),s.count('#'))
flag=0
prev=s[0]
for i in s:
    if  i==prev:
        pass
    else:
        flag+=1
        prev=i
if flag==1:
    ans=0
print(ans)
        