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

cnt = 0
z = 0
if N == 1:
    print("0")
    exit()
else:
    for i in range(N-1):
        x = S[i]
        y = S[i+1]
        if x == "#":
            if y == ".":
                cnt += 1
                S = S[0:i+1] + "#" + S[i+2:N]
print(cnt)