N=int(input())
S=input()
l=[]
for i in range(N-1):
  if S[i:i+2]=='.#':
    l.append(i)
ans=[]
if l==[]:
  print(0)
else:
  for j in range(len(l)):
    ans.append(S[:i].count('#')+S[i+2:].count('.'))
  print(min(ans))