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