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

state = False
counter = 0

for i in range(N):
  if S[i] == ".":
    counter += 1
  else:
    break
S_1 = S[counter:]

for i in range(len(S)):
  if S[i] == "#":
    state = True
    counter += 1
  else:
    counter = 0
    state = False
if state == True:
  S_3 = S_1[:-1*counter]
  S_2 = S[:-1*counter]
else:
  S_3 = S_1
  S_2 = S
  
b_1 = S_1.count("#")
w_1 = len(S_1) - b_1

b_2 = S_2.count("#")
w_2 = len(S_2) - b_2

b_3 = S_3.count("#")
w_3 = len(S_3) - b_3

print(min(b_1, b_2, b_3, w_1, w_2, w_3))
