N = int(input())
S = input()
count = 0
ans = []
b_num = 0
w_num = 0
w_all = S.count('.')
for i in range(N):
  if S[i] == '#':
    b_num += 1
  if S[i] == '.':
    w_num += 1
  ans.append(w_all-w_num+b_num)
print(min(ans))