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

if N == 1:
    print(0)
    exit()
if N == 2:
    if S[0] == "#" and S[1] == ".":
        print(1)
    else:
        print(0)
    exit()

ans = 0
for i in range(1,N):
    if S[-i] == "." and S[-i-1] == "#":
        if i == N - 1:
            ans += 1
        elif S[-i-2] == "#":
            S[-i] = "#"
            ans += 1
        else:
            S[-i-1] = "."
            ans += 1
print(ans)
