import sys

N =  int(sys.stdin.readline())
S = sys.stdin.readline()[:-1]
res = 0


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)
