n=int(input())
s_0=input()

    
change=0
s = list(s_0)

#blackのが多い
for i in range(1,n):
  if s[i-1]=="#" and s[i]==".":
    change=change+1
    s[i]="#"


#白のが多い
if change > n - change:
  change=n-change
  if s[n]=="#":
    change=change-1

print(change)