n = int(input())
k,d = 0,0
s = list(input())

if s[0] == '.':
  c = 0
  for j in s:
    if j == '.':
      c+=1
    else:
      break
  r = 0    
  if s[n-1] == '#':
    for p in range(n-1,0,-1):
      if s[p] == "#":
        r += 1
      else:
        break
      
  for i in range(c,n-r):
    if s[i] == '#':
      k+=1
    else:
      d+=1
  
  
else:
  r = 0
  if s[n-1] == '#':
    for o in range(n-1,0,-1):
      if s[o] == "#":
        r += 1
      else:
        break

  for m in range(n-r):
    if s[m] == '#':
      k+=1
    else:
      d+=1
print(min(k,d))  