import numpy as np
n=2
a=[input() for i in range(n)]
N=int(a[0])
S=list(a[1])
 
kazuXD=0
flg=0
kazu=0
geri=0
for i in range(N):
  if S[i]=="#":
    geri+=1
for i in range(N):
  if flg==0:
    if S[i]==".":
      kazu+=1
    else:
      flg=1
flg=0
for i in range(N):
  if i>=kazu:
    if S[i]==".":
      kazuXD+=1

if geri>kazuXD:
  print(kazuXD)
else:
  print(geri)
  