N=int(input())
s=input()
S0=[]
S1=[]
for i in range(N):
  S0.append(s[i])
  S1.append(s[i])
c0=0
for i in range(N-1):
  if S0[i]=='#' and S0[i+1]=='.':
    S0[i+1]='#'
    c0+=1
c1=0
for i in range(N-2,-1,-1):
  if S1[i]=='#' and S1[i+1]=='.':
    S1[i]='.'
    c1+=1
print(min(c0,c1))

