N = int(input())
S = input()
start,end = 0,0
for i in range(N):
  if S[-i+1] == '.':
    end = N-i+1
    break
for i in range(N):
  if S[i] == '#':
    start = i
    break
M = S[start:end]
print(min(M.count('.'),M.count('#')))