n=int(input())
s=input()


black=0
white=0
for st in s:
  if st=="#":
    black=black+1
  else:
    white=white+1
change=0
s = list(s)

if black>white:
  for i in range(n-1):
    if s[i]=="#" and s[i+1]==".":
      change=change+1
      s[i+1]="#"

else:
  for i in range(n-1):
    if s[i]=="#" and s[i+1]==".":
      change=change+1
      s[i]="."

print(change)