def countc(color,num):
  cnt=0
  if color=='#':
    for i in range(num):
      if S[i]=='#':
        cnt+=1
  else:
    for j in range(num,N):
      if S[j]=='.':
        cnt+=1
  return cnt


import sys
input=sys.stdin.readline
N=int(input())
S=input()[:-1]
c=N*2
for i in range(N+1):
  c = min(c,countc('#',i)+countc('.',i))
print(c)