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

num_of_white = 0
num_of_black = 0

for i in range(1, N):
  if S[idx] == '.':
    num_of_white += 1

result = num_of_white

for i in range(1, N):
  if S[i-1] == '#':
    num_of_black += 1
  if S[i] == '.':
    num_of_white -= 1
  
  if result > (num_of_black + num_of_white):
    result = num_of_black + num_of_white

print(result)