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

index_1 = [i for i in range(N) if S[i] == "."]
index_2 = [j for j in range(N) if S[j] == "#"]

if S[0] == "." and S[1] == "#":
  if S[N-1] == "#" and S[N-2] == ".":
    print(min(len(index_1)-2, len(index_2)-2))
  else:
    print(min(len(index_1)-1, len(index_2)-1))
elif S[N-1] == "#" and S[N-2] == ".":
  print(min(len(index_1)-1, len(index_2)-1))
else:
  print(min(len(index_1), len(index_2)))