N = int(input())
S = input()
count = 0
count_b = []
count_w = []
b_num = 0
w_num = 0
for i in range(N):
  if S[i] == '#':
    b_num += 1
  if S[i] == '.':
    w_num += 1
  count_w.append(w_num)
  count_b.append(b_num)
ans = 100000
for i in range(N):
  if ans > count_b[i]+count_w[i]:
    ans = count_b[i]+count_w[i]

print(ans)
