n=int(input())
s=list(input())
num=[]
str1="#"
num3=0
num2=0
if s[0]==".":
    num2=n
    for i in range(n):
        if s[i]==str1:
            num2=i
            break
for i in range(num2,n):
    if s[i]==str1:
        num3+=1
    else:
        if str1=="#":
            str1="."
        else:
            str1="#"
        num.append(num3)
        num3=1
num.append(num3)
numb=0
numw=0
for i in range(len(num)):
    if i%2==0:
        numb+=num[i]
    else:
        numw+=num[i]
print(min(numb,numw))
