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

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

idx_list = []
for i in range(N-1):
  if S[i] != S[i+1]:
    idx_list.append(i)

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