N = int(input())
S = input()

flag = False
white = 0

for s in S:
    if s == "#":
        flag = True
    if flag:
        if s == ".":
            white += 1

flag = False
black = 0

for s in S[::-1]:
    if s == ".":
        flag = True
    if flag:
        if s == "#":
            black += 1

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