n = int(input())
s = input()
a = 0
ans = 0
for i in range(n):
  if s[i] == '.':
    ans += 1
a = ans
for i in range(n):
  if s[i] == '.':
    a -= 1
  else:
    a += 1
  if a < ans:
    ans = a
print(ans)