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
      
  for i in range(c,n):
    if s[i] == '#':
      k+=1
    else:
      d+=1
  
  
else:
  for i in range(n):
    if s[i] == '#':
      k+=1
    else:
      d+=1
print(min(k,d))   