N = int(input())
S = input()
if S.count('#') < S.count('.'):
  ans = S.count('#')
else:
  ans = S.count('.')
count = 0
for i in range(N-1):
  if S[i] == '#' and S[i+1] == '.':
    count+=1
if count<ans:
  print(count)
else:
  print(ans)
