#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()
ans=n
wtb,btw=0,0
for i in range(n-1):
    for j in range(i+1):
        if s[j]=="#":
            btw+=1
    for j in range(i+1,n):
        if s[j]==".":
            wtb+=1
    tmp=wtb+btw
    if ans>tmp:
        ans=tmp
count=0
for i in range(n):
    if s[i]=="#":
        count+=1
wtb=n-count
btw=count
m=min(wtb,btw)
if ans>m:
    ans=m

print(ans)
