N=int(input())
S=list(input())
ans1=0
ans2=0
for i in range(N-1):
  if S[i]=='#':
    ans1+=1
for i in range(N-1):
  if S[i]=='#':
    if S[i+1]=='.':
      S[i+1]='#'
      ans2+=1
print(min(ans1,ans2))