n = int(input())
s = input()
c = 0
sl = list(s)
sl2 = sl
k = 0
for i in range(n-2):
   if sl[i]=="#" and sl[i+1]==".":
      if sl[i+2]=="." and sl[i-1]==".":
        sl[i]='.'
        c = c + 1
      if sl[i+2]=="." and sl[i-1]=="#":
        sl[i+1]='#'
        sl[i+2]='#'
        c = c + 2
      elif sl[i+2]=='#':
        sl[i+1]='#'
        c = c + 1
if sl[n-2]=="#" and sl[n-1]==".":
  sl[i+1]='#'
  c=c+1
print(c)