N=int(input())
S=input()

ans = 100000
flag=False
for i,s in enumerate(S):
  if(i==0):
    last_s = s
    continue
  else:
    if last_s == "." and s == "#":
      flag=True
      cld = S[:i].count('.')
      clh = S[:i].count('#')
      crd = S[i+1:].count('.')
      crh = S[i+1:].count('#')
      ans=min(ans, min(cld,clh)+min(crd,crh))

    last_s = s

if(not flag): print(0)
else: print(ans)