N=int(input())
S=list(input())
c=0
b=S.count('#')
for i in range(1,N):
  if S[i-1]=='#'and S[i]=='.':
    S[i]='#'
    c+=1
  elif S[i-1]=='.'and S[i]=='#':
    f=False

if c>b:
  print(b)
else:
  print(c)