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

state = False
counter = 0

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

for i in range(len(S)):
  if S[i] == "#":
    state = True
    counter += 1
  else:
    counter = 0
    state = False
if state == True:
  S = S[:-1*counter]
  
b_num = S.count("#")
w_num = len(S) - b_num
if b_num <= w_num:
  print(b_num)
else:
  print(w_num)