from sys import exit
N = int(input())
# a = [int(input()) for _ in range(N)]
S = str(input())
white = False
ans0=0
ans1=0
for i in range(len(S)-1,-1,-1):
    if(S[i] == "."):
        white = True
    elif(white and S[i] == "#"):
        ans0+=1
black = False
for i in range(len(S)):
    if(S[i] == "#"):
        black = True
    elif(black and S[i] == "."):
        ans1+=1
print(min(ans0,ans1))
