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)
now=-1

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

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

if change > n - change:
  change=n-change
print(change)