from itertools import*
n=int(input())
s=input()
t=s.count("#")
r=s.count(".")

l=[t,r]
x=[[k,len(list(v))]for k,v in groupby(s)]
ans=0
for i in range(len(x)):
    n,m=x[i]
    #print(t,r)
    if n==".":
        r-=m
        l.append(r)
    else:
        l.append(t)
        t-=m
        ans+=m
        l.append(ans+r)
l.append(t)
print(min(l))