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
for i in range(N):
  if flg==0:
    if S[i]==".":
      kazu+=1
    else:
      flg=1
flag=0
unko=0
for i in range(N):
  if flag==0:
    if S[N-i]=="#":
      unko+=1
    else:
      flag=1
for i in range(kazu,N):
  if S[i]==".":
    S[i]="#"
    kazuXD+=1

kazuta=0
for i in range(unko,N):
  if S[N-i]=="#":
    S[N-i]="."
    kazuta+=1
if kazuXD>=kazuta:
  print(kazuta)
else:
  print(kazuXD)