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

black = S.count('#')
white = N - black

answer = 0
if (white > 0 and black > 0):
  answer = min(black, white)
  black_left = 0
  white_left = 0
  for i in range(N - 1):
    if (S[i] == '#'):
      black_left += 1
    else:
      white_left += 1
    black_right = black - black_left
    white_right = white - white_left
    print(black_left, white_right)
    answer = min(answer, black_left + white_right)

print(answer)
