def ns():
    import sys
    return map(int, sys.stdin.readline().split())
  
def ss():
    import sys
    return sys.stdin.readline().strip()
  
N, = ns()
S = ss()

ans = float('inf')
for i in [0]*N:
  c = 0
  for s, t in zip(S, '.'*i+'#'*(N-i)):
    if s != t:
      c += 1
  ans = min(ans, c)
print(ans)