n = int(input())
s = list(input())


for i in range(n):
  if s[i] == '.':
    s[i] = ''
  if s[i] == '#':
    break

s = s[::-1]

for i in range(n):
  if s[i] == '#':
    s[i] = ''
  if s[i] == '.':
    break

ans1 = s.count('.')
ans2 = s.count('#')
print(min([ans1, ans2]))
