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

key = [False]*n

ans1 = 0
for i in range(1, n):
  if (s[i-1] == "#" or key[i-1]) and s[i] == "." :
    ans1 += 1
    key[i] = True

ans2 = 0
for i in range(n-1, 0, -1):
  if (s[i] == "." or key[i]) and s[i-1] == "#":
    ans2 += 1
    key[i-1] = True

print(min([ans1, ans2]))