n = int(input())
s = input()
n=len(s)
x = 0
for i in range(n-1):
    if s[i] == "#" and s[i + 1] == ".":
        y1=0
        for j in reversed(range(i + 1)):
            if s[j] == "#":
                y1 += 1
            else:
                break
        y2=0
        for k in range(i+1, n):
            if s[k] == ".":
                y2 += 1
            else:
                break

        x+=min(y1, y2)


print(str(x))
