n=int(input())
s=list(input())
s2=s[:]
s2.reverse()
c=0
for i in range(len(s)):
  a=s[i]
  if a=='#':
    if i!=len(s)-1 and s[i+1]=='.':
      s[i+1]='#'
      c+=1
c2=0
for i in range(len(s2)):
  a=s2[i]
  if a=='.':
    if i!=len(s2)-1 and s2[i+1]=='#':
      s2[i+1]='.'
      c2+=1
print(min(c,c2))