import sys
input=sys.stdin.readline
N=int(input())
S=input()
c=N
for i in range(N):
  b=0;w=0
  for j in range(N):
    if (i>=j) and S[j]=='#':
      b+=1
    elif (i<j) and S[j]=='.':
      w+=1
  c=min(c,b+w)
print(c)
