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