N = int(input())
S = input()
res = 0

for i in range(N-1):
  if S.count('#') < S.count('.'):
    if S[-1] != '#':
      res = S.count('#')
    else:
      res = S.count('#') -1
  else:
    if S[0] != '.':
      res = S.count('.')
    else:
      res = S.count('.') - 1

print(res)
