n = int(input().strip())
s = input().strip()
 
mincnt = n

for j in range(n):
  cnt = 0
  for i in range(j):
    if s[i] != ".":
      cnt += 1
      if cnt>mincnt:
          break 
  for i in range(j+1,n):
    if s[i] != "#":
      cnt += 1
      if cnt>mincnt:
          break  
      
  if cnt < mincnt:
    mincnt = cnt
  
  

print(mincnt)
