import copy
N=int(input())
S=list(input())
ans1=0
tmp=0
ans2=0
A=copy.copy(S)
for i in range(N-1):
  if A[N-i-1]=='#' and A[N-i-2]=='#':
    A.pop(N-i-1)
    tmp+=1
  else:
    break
for i in range(N-tmp-1):
  if A[i]=='#':
    ans1+=1
for i in range(N-1):
  if S[i]=='#':
    if S[i+1]=='.':
      S[i+1]='#'
      ans2+=1
print(min(ans1,ans2))