#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]=="#":
        count+=1
        if flag==-1:
            flag=i
if count==0:
    ans=0
elif count==n:
    ans=0
else:
    a=count #black to white
    b=n-count-flag #white to black
    ans=min(a,b)

print(ans)
