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

w = S.count('.')
b = S.count('#')
cnt = 0
for i in range(N):
  if S[i] == '#':
    cnt += 1
  else:
    break
for i in range(1, N+1):
  if S[N-i] == '.':
    cnt += 1
  else:
    break
    
ans = min(w, b, cnt)
print(ans)