N = int(input())
S = input()
answ = S[0]
ansb = S[0]
cntw = 0
cntb = 0
for i in range(1, N):
  if answ[-1]=='#' and S[i]=='.':
    answ+='#'
    cntw+=1
  else:
    answ+=S[i]
  
  if ansb[-1]=='.' and S[i]=='#':
    ansb+='.'
    cntb+=1
  else:
    ansb+=S[i]
    
print(min(cntw,cntb))