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

r_list = []
lb = 0
rw = S.count(".")
r_list.append(lb + rw)
for i in range(N):
  if S[i] == "#":
    lb += 1
  else:
    rw -= 1
  r_list.append(lb + rw)
print(min(r_list))