n = int(input())
s = list(input())
b = 0
w = 0
for i in range(n):
    if s[i] != ".":
        b += 1
    else:
        w += 1
for i in range(n):
    if s[i] == ".":
        w -=1
    else:
        break
print(min(b,w))
