N=int(input())
S=list(input())
A=S
B=S[:: -1]
ans1=0
ans2=0

for i in range(N-1):
  if A[i]=='#' and A[i+1]=='.':
    A[i+1]='.'
    ans1 += 1

for i in range(N-1):
  if B[i]=='.' and B[i+1]=='#':
    B[i+1]='#'
    ans2 += 1

print(min(ans1,ans2))