n=int(input())
s=input()
cnt=0
if '#' in s:
    if s[n-1]=='.':
      for i in range(s.index('#'),n):
        if s[i]=='#':
          cnt+=1
      if cnt>len(s[s.index('#'):])//2:
        print(len(s[s.index('#'):])-cnt)
      else:
        print(cnt)
    else:
      for i in range(s.index('#'),n-1):
        if s[i]=='#':
          cnt+=1
      if cnt>len(s[s.index('#'):n-1])//2:
        print(len(s[s.index('#'):n-1])-cnt)
      else:
        print(cnt)
else:
  print(0)