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

def dfs(stones, start, count):
  if(N-1<=start): return count
  for i in range(start, N-1):
    if(stones[i]=="#" and stones[i+1]=="."):
      return min(dfs(stones[:i]+"."+stones[i+1:], start+1, count+1), dfs(stones[:i+1]+"#"+stones[i+2:], start+1,count+1))
  return count

print(dfs(S, 0, 0))