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

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

base_count = S.count(".#")

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