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

def counting(seq, s):
  return seq.count(s)

base_count = S.count("#.")

S = S.replace("#.", "")

idx_list = [0, len(S)]
for i in range(len(S)-1):
  if S[i] == "." and S[i+1] == "#":
    idx_list.append(i)

count_list = []
for i in idx_list:
  count_list.append(counting(S[:i+1], "#") + counting(S[i+1:], "."))
count_list.append(counting(S, "#")+0)
print(min(count_list) + base_count)