n=int(input())
s=list(input())	
s2 = s[:]

cnt1=0
for i in range(len(s) -1 ):
    if(s[i] == "#" and s[i + 1] == "."):
        s[i+1]="#"
        cnt1 +=1
cnt2=0

for i in range(len(s2) -1 ):
    if(s2[n-i-1] == "." and s2[n-i- 2] == "#"):
        s2[n-i-2]="."
        cnt2 +=1

print(min(cnt1,cnt2))