#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
#import math
#n=int(input())
#li=input().split()
#S=input()
#import fractions
#lis=list(map(int,input().split()))

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

count=0 #black
flag=-1 #first black
for i in range(n):
    if s[i]=="#" and flag==-1:
        flag=i
        break
a="."*flag+"#"*(n-flag)
b="."*n
c="#"*n
aa,bb,cc=0,0,0
for i in range(n):
    if a[i]!=s[i]:
        aa+=1
for i in range(n):
    if b[i]!=s[i]:
        bb+=1
for i in range(n):
    if c[i]!=s[i]:
        cc+=1

ans=min(aa,bb,cc)

print(ans)
