# -*- coding: utf-8 -*-
N = int(input())
S = str(input())

ans_black = 0
ans_white = 0

for i in range(N-1):
  #print(i,end="")
  #print(S[i])
  if S[i]=="#" and S[i+1]==".":
    ans_black=ans_black + 1
  if S[i]=="#":
    ans_white=ans_white + 1  

ans=min(ans_white,ans_black)
print(ans)