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

white = 0
black = 0

for i in range(n):
    if s[i] == "#":
        black += 1
    elif s[i] == ".":
        white += 1

if white != 0:
    if s[0] == ".":
            white -= 1
if black != 0:
    if s[n-1] == "#":
            black -= 1

ans = min(black, white)
print(ans)