n=int(input())
s=input()
cnt=0
left=0
right=0
for left in range(n-1):
  if s[left]=='#' and s[left+1]=='.':
    right=left+1
    while s[right]=='.' and right < n-1:
        right+=1
    cnt+=right-1-left
    left=right+1
  else:
    left+=1

if s.count('.')==n:
  print(0)
else:  
  print(cnt if s[-1]=='#' else cnt+1)    
   